Skip to content

Important fix - ensure objects are buffer aligned to fix graphics crashes#84

Open
AlexanderHarrison wants to merge 2 commits intoPloaj:masterfrom
AlexanderHarrison:master
Open

Important fix - ensure objects are buffer aligned to fix graphics crashes#84
AlexanderHarrison wants to merge 2 commits intoPloaj:masterfrom
AlexanderHarrison:master

Conversation

@AlexanderHarrison
Copy link

We've been having a ton of graphics crashes in Training Mode - More for a while. This bug was incredibly obnoxious to track down, and I don't want to make you or anyone else go through this hell, so this should be fixed (with this pr or however you prefer it done) asap.

When fixed, could you update the MexTK build with the patch?

Thanks for your hard work! This is by far the most underappreciated project in the community.

@AlexanderHarrison AlexanderHarrison marked this pull request as draft October 25, 2024 07:36
@AlexanderHarrison
Copy link
Author

Looks like this isn't quite working as I expected. Working on it.

@AlexanderHarrison
Copy link
Author

AlexanderHarrison commented Oct 27, 2024

I've changed to a different approach. Instead of marking the objects that need to be buffer aligned, we always buffer align all objects.

Pros:

  • Much simpler. Much less code. There's probably even more code that can be thrown out with this change (namely the IsBufferAligned property). This change is a net negative in code!
  • No need to track what object something is. I was having issues where compiling code into a dat with MexTK would unalign previously buffer-aligned structs. I don't know enough about MexTK to know if that is solvable, but always buffer aligning makes it trivial.
  • Implementing a different fix would be complex and error prone. Needing to track the type of objects throughout HSDRaw and MexTK would be complicated.

Cons:

  • Wasted dat space. For context, LabCSS.dat in Training Mode increases from 0x8B07 to 0x8F37 with this change. About a 1k (+3%) increase in size. I believe a 3% increase in size is worth the change.

@AlexanderHarrison AlexanderHarrison marked this pull request as ready for review October 27, 2024 20:22
@AlexanderHarrison AlexanderHarrison changed the title Important fix - ensure buffer aligned structs are always set as buffer aligned Important fix - ensure objects are buffer aligned to fix graphics crashes Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant