Claude/refactor reloadmod fix i l1 kd#77
Merged
Conversation
Some games (e.g. "2015g1") first draw a modded mesh with a vertex layout that lacks NORMAL (likely a depth/shadow pass). The mod VB gets filled from that layout, leaving zeros where the normal should be. A later draw with a layout that does include NORMAL then reuses the bad VB and the mod renders with garbage normals. Detect that mismatch and refill: - Store a u128 bitmask of (semantic, semantic_index) pairs declared by the fill layout on ModD3DData11, populated in load_d3d_data11. - On each modded draw, recompute the current layout's mask and bail out to the reload path if it has any bits the fill mask doesn't. - Hot-path check is two map lookups + a bitwise op; no locks, no global. The closure passed to check_and_render_mod gets only an immutable mod ref, so the refill request bubbles up via an override variable and the existing NotRenderedButLoadRequested handler does the work, via a new mod_load::reset_for_reload helper that releases the d3d data and transitions back to Unloaded. https://claude.ai/code/session_018KSB4LpgEY7ZyheoHr1A4Y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.