Keep structured buffer reads raw on heaps without descriptor twins #23
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!23
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-23"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@gomeaw on GitHub · 2026-11-25 23:42 UTC · original
gomeaw:fix/raw-buffer-views-without-twins→main· +49 −16 · 1 files · 2 commits · merged 2026-11-26 08:17 UTCFix
The shader translator reads untyped structured buffers as raw bytes. On a heap without raw descriptor twins, a structured view can start on one of its own elements but miss D3D12's 16-byte raw alignment. A stride-56 view with
FirstElement=1is one example. The host currently accepts a structured descriptor in that slot, and a raw shader read through it can return zero on NVIDIA.Use the existing copy of a view's own bytes for this alignment case when the heap has no twins. The slot can then use a raw descriptor starting at byte zero. Both descriptor creation and refresh select the same copy. This covers SRVs and UAVs and uses the existing copy limits and lifetime tracking.
The related RTX 5090 investigation found a raw/structured descriptor mismatch in the hit-detection shader
eeed82b877b44b5f. This fork already uses raw reads and, where supported, raw twins. This PR addresses the case where the heap cannot provide a twin. It needs a targeted retest of that shader on this fork. RTX 5090 investigationVerification
The Windows check disables raw twins on WARP and uses a registered buffer with a deliberately misaligned first element. With the old placement strategy the regression kept the whole registered buffer and failed the view-span assertion. With the change it selected the exact view span and both descriptor creation and refresh used the same D3D12 resource. All 33 descriptor tests and the asset policy passed. Windows comparison
AI-assisted with Codex. The tests use synthetic data.
@avatarmanz on GitHub · 2026-11-26 07:55 UTC · original
Merged into main in the next push (tests pass); thanks.