Keep structured buffer reads raw on heaps without descriptor twins #23
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by gomeaw on 2026-11-25T23:42:15Z.
Fix
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.
Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:55:56Z.
Merged into main in the next push (tests pass); thanks.