Repository navigation
Conversation
- Lower s_load_dword* directly on RootType::Descriptor views (root_cbv_handle / root_srv_handle) instead of falling through to descriptor_data. - Unify SRV/UAV buffer handle selection (buffer_srv_uav_props) across s_buffer_load_dword*, buffer_*, and descriptor_data, supporting scalar loads from structured buffers and Fields::Smem consumers. - Reconstruct descriptor metadata across multi-slot s_load_dword* loads, populate buffer V# dword 1 stride bits, support Cube/2DMS/2DMSArray image dimensions and atomic image UAV annotations, infer view kinds from twin dynamic/waterfall loads and UsedResource table entries, and ignore dead descriptor-dword phi edges when another reachable path carries scalar data. - Add 3 dxil.dll + hardware GPU + WARP execution tests in valu_tests covering structured s_buffer_load_dwordx2 + multi-slot s_load_dwordx16 metadata, Root CBV/SRV scalar loads, and twin bindless loads + descriptor-only UsedResource queries + dead descriptor-dword phi joins.
catminou4
left a comment
There was a problem hiding this comment.
Scalar root CBV/SRV loads and descriptor-as-data queries. root_smem handles s_load_dword{,x2,x4,x8,x16} from RootType::Descriptor params: SRV via rawBufferLoad.f32 per dword, CBV via cbufferLoadLegacy with 16-byte row caching for static offsets and cbuffer_dword for dynamic ones, UAV/typed roots rejected conservatively; s_dcache_inv/s_gl1_inv become no-ops (cache hints, no correctness impact). buffer_srv_uav_props keeps heap view kinds consistent across s_buffer_load/buffer_*/descriptor_data. Large diff (+1365) — the structure is sound and merge is clean; the valu_tests additions are Windows-gated, so please make sure the Windows run covers the CBV row-index units (cbufferLoadLegacy index granularity) since that's the one thing macOS can't check. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main ffe310e, cargo test -p victory-shader --locked. Shader execution tests (valu_tests/host/diff_tests) are #[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. 96 passed, 0 failed.
Data from a retail dump: what this PR would meet after #1402Summary: #1402 makes "a descriptor's address or format read as data" the largest failure. This PR targets the same area, but it conflicts with #1402. I measured #1402 on a retail dump (details). With #1402, "a descriptor's address or format read as data" becomes the largest failure: 809 programs, against 92 on To get the breakdown, I made a local build that adds the descriptor dword and the view kind to the reason. Counts by the dword read as data:
Most of these are raw buffers, so a real address dword is read. In one program I traced (a mesh shader), the descriptor's registers are reused for This PR conflicts with #1402 in No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
buffer_srv_uav_props chose a structured view for s_buffer_load_dword* whenever the resource table recorded a stride, even when no buffer_* access of the descriptor indexes records. The table's stride alone does not show the title's view is structured: on a title whose view is raw, the structured annotation read zeros and the whole presented frame went black (every pass fed by those loads saw 0). On a 32-lane NVIDIA host a mismatched heap annotation reads zeros either way, so the byte-offset loads now take a structured view only when a buffer_* access of the same descriptor indexes records (as that access itself lowers), and stay raw otherwise, as before this branch. The descriptor-as-data query keeps the recorded stride. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed Symptom: on an RTX 5090 (Windows 11), a title that rendered its boot/menu screens on Cause: Fix: the byte-offset loads are structured only when a
AI-assisted fix, checked on Windows 11 / RTX 5090. |
|
Automated triage for the maintainers. Closing because this change is already in 1,338 lines on scalar root-view loads and descriptors read as data, written against ffe310e. Main covers the same ground since (75677cb sizes and twin loads, 27c3dc9 and d71c388 root views, 683ad7a table constants); what is left (cube/MSAA dimensions) is #317. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Summary
Rebased cleanly onto
upstream/main(ffe310e):s_load_dword*directly onRootType::Descriptorviews (root_cbv_handle/root_srv_handle) instead of falling through todescriptor_data.buffer_srv_uav_props) acrosss_buffer_load_dword*,buffer_*, anddescriptor_data, supporting scalar loads from structured buffers andFields::Smemconsumers.s_load_dword*loads, populates bufferV#dword 1 stride bits, supportsCube/2DMS/2DMSArrayimage dimensions and atomic image UAV annotations, infers view kinds from twin dynamic/waterfall loads andUsedResourcetable entries, and ignores dead descriptor-dwordphiedges when another reachable path carries scalar data.dxil.dll+ hardware GPU + WARP execution tests invalu_testscovering structureds_buffer_load_dwordx2+ multi-slots_load_dwordx16metadata, Root CBV/SRV scalar loads, and twin bindless loads + descriptor-onlyUsedResourcequeries + dead descriptor-dwordphijoins.Verification
cargo clippy -p victory-shader --all-targets— passedcargo test -p victory-shader— passedcargo xtask policy— passed