Repository navigation
Shaders: lower unlisted table constant buffer loads as guarded raw SRVs - #2068
fuzeofficlal wants to merge 1 commit into
Conversation
|
Triage verdict — Keep the descriptor-kind fixes, leave #1595 open for typed-null coverage ( Evidence
Checks and limits
Next step
This verification was AI-assisted. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
cargo test -p victory-shader --lib an_unlisted_table_constant_load_reads_as_a_raw_buffer— passed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo test -p victory-gpu --lib table_stride_separates_shader_and_unordered_buffers— passedcargo clippy -p victory-shader -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean lowering of unlisted table constant loads as raw SRVs and separation of SRV/UAV buffer guards across victory-shader and victory-gpu. Looks good.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.
144 passed / 0 failed / 2 ignored. Unlisted table constant loads as raw SRVs — table-constant fallback path; mixed gpu+shader, gpu half Windows-only.
cba3f26 to
421de01
Compare
|
Thanks @jeremygold02 — pushed
|
Offline measurement on a retail dumpResult: no count change against I merged head 421de01 onto No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
|
Automated triage for the maintainers. Recommended for a look (merge candidate). After the rebase, scalar buffer loads whose descriptor comes from a table slot with no used-resource entry are lowered as raw buffer SRV reads, guarded through the view-stride table, instead of Generated by Claude Code |
421de01 to
7c8c0f7
Compare
|
Updated in
|
Scalar buffer loads (s_buffer_load_dword*) from descriptor table slots (RootType::Table) with no matching UsedResource entry (kind.is_none()) previously fell back to createHandleFromHeap annotated as CBV (13, 0x1_0000) with cbufferLoadLegacy and bypassed Lower::buffer_guard and heap refresh (self.heap[0]). When an indexed table slot points at a non-buffer descriptor such as the title's null Texture1D SRV at heap slot 0, D3D12 GBV and WARP fail with a CBV-over-SRV descriptor type mismatch. Restrict smem's heap_constants expansion, unlisted-table heap tracking, and Lower::buffer_guard to descriptors whose leaves are all tracked loads from RootType::ResourceHeap or RootType::Table, lowering them as raw buffer SRVs (11, 0) guarded by VIEW_STRIDES against non-buffer slots. Leave VIEW_STRIDES buffer-vs-non-buffer semantics unchanged so existing buffer views are never zeroed. Closes Marvisak#1595
7c8c0f7 to
05361f4
Compare
|
Automated triage for the maintainers, second look (a review against current Closing because the issue it closes, #1595, is fixed in If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution. |
Closes #1595.
Summary
s_buffer_load_dword*) fromRootType::Tabledescriptors with no matchingUsedResourceentry (kind.is_none()) as guarded raw buffer SRVs(11, 0)instead ofcbufferLoadLegacyCBV handles(13, 0x1_0000).heap_constants, unlisted-tableself.heaptracking, andLower::buffer_guardstrictly to descriptors whose leaves are all tracked loads fromRootType::ResourceHeaporRootType::Table(is_view_heap/is_unlisted_table), leavingSource::Constant,Source::Built, other root parameters, andVIEW_STRIDESbuffer-vs-non-buffer (stride == 0) semantics unchanged.Verification
emit::stride_tests::an_unlisted_table_constant_load_reads_as_a_raw_buffer: tests unlistedRootType::Tables_buffer_load_dwordagainstView::NullTexture1d(slot 0 -> 0),View::Texture(slot 1 -> 0), andView::Buffer(slot 2 -> 9) across NVIDIA GeForce RTX 5090, AMD Radeon(TM) Graphics, and D3D12 WARP.emit::stride_tests::unlisted_table_constant_lowering_rejects_non_heap_sources: verifiesSource::Constant,RootType::Constants, and mixedTable+Constantphis remain rejected while pureTablephis lower and validate viadxil.dll.cargo clippy -p victory-shader --tests --locked -- -D warningsandcargo xtask policy: passed.