Skip to content

Claude/refactor reloadmod fix i l1 kd#77

Merged
jmquigs merged 2 commits into
masterfrom
claude/refactor-reloadmod-fix-iL1Kd
May 12, 2026
Merged

Claude/refactor reloadmod fix i l1 kd#77
jmquigs merged 2 commits into
masterfrom
claude/refactor-reloadmod-fix-iL1Kd

Conversation

@jmquigs
Copy link
Copy Markdown
Owner

@jmquigs jmquigs commented May 12, 2026

No description provided.

claude and others added 2 commits May 12, 2026 21:08
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
@jmquigs jmquigs merged commit 5d3cb2e into master May 12, 2026
1 check passed
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.

2 participants