victory-shader: infer 4-dword buffer views from UsedResource in descriptor_data #1325
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1325"
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 Marvisak/VIctory. Originally posted by bartikele on 2026-11-24T17:26:21Z.
In
Lower::descriptor_data, whenuse_atisNone(noRole::Resourcedescriptor inself.x.res.descriptorsreferences thes_load_dword*site, e.g. a shader that only callsGetDimensionson a buffer without issuingbuffer_load/s_buffer_load), fall back toself.used_kind(&Source::Loaded { load: site, first: 0 }):used.dwords == 4andused.kindisSrvorUav, infer the buffer view properties ((12 | u, used.stride)for 4-byte-aligned strides >= 4, else(11 | u, 0)) and emitgetDimensionsfor word 2.ResourceType::Cbvwitha constant buffer's descriptor read as data.Adds unit test
emit::lower::tests::buffer_descriptor_size_read_without_buffer_op_lowers.Tested with:
cargo clippy -p victory-shader --all-targets --locked -- -D warningscargo test -p victory-shader --lockedcargo xtask policyImported from Marvisak/VIctory. Originally posted by shortselow-byte on 2026-11-24T17:54:43Z.
For triage: this is the third open PR changing the same branch of
descriptor_data(the load with no resource use,use_at == None, refused as "a descriptor read only as data"):UsedResourcewhen it has four dwords.git merge-treeagainst the current heads: this PR conflicts inemit/lower.rswith both #1067 (6d30fd7) and #1130 (98f073d), which also conflict with each other. A one-line combination of those two is in the comments on #1067 and #1130; this PR's four-dword buffer case could be a third fallback in the samematch, rather than a third rewrite of it.Imported from Marvisak/VIctory. Originally posted by bartikele on 2026-11-24T18:02:27Z.
Closing as subsumed by #1067 — #1067 already handles the 4-dword buffer
UsedResourcefallback indescriptor_data(alongside 8-dword images and a full GPU waterfall test), so keeping this open would just create unnecessary merge conflicts.Pull request closed