Skip to content

GPU: refresh and copy back the buffer bound to each table slot - #4

Open
mohammadallami75-ops wants to merge 1 commit into
mainfrom
fix/table-buffer-shadow-coherency
Open

mohammadallami75-ops wants to merge 1 commit into
mainfrom
fix/table-buffer-shadow-coherency

Conversation

@mohammadallami75-ops

@mohammadallami75-ops mohammadallami75-ops commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Problem

The host descriptor is built using a shadow that covers the buffer allocation. Table binding then independently looks up a shadow for the view’s byte range. When a smaller title allocation overlaps that range, the second lookup can select the smaller allocation’s shadow. The GPU uses the original shadow, so the refresh can leave it stale and UAV writes can miss title memory on copy-back.

Change

Retain the shadow alongside each host buffer descriptor and use it for table-bound refresh and copy-back. This covers mirrored slots and newly built or reused dynamic tables. The fix concerns table-bound buffer identity. Related changes cover directly indexed SRV coherency and buffer state transitions.

Verification

  • Synthetic overlapping-UAV regression on ffe310e: title memory retained its sentinel after a native GPU write to the descriptor’s shadow. With the patch the exact GPU-written word reached title memory and both neighbors retained their sentinels.
  • RTX 2080 SUPER and WARP passed the regression. Workspace tests, all-features workspace Clippy with warnings denied, and the asset policy check passed.
  • Synthetic data only. In-game impact remains unverified. An in-game check from a tester who can identify an overlapping table-bound buffer would be welcome.

AI-assisted implementation and testing.

Overlapping title allocations can select different host shadows for a
resource and a subrange. Keep the shadow with the host descriptor and
use it for table-bound SRV refresh and UAV copy-back.

AI-assisted implementation and testing.
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