victory-shader: infer 4-dword buffer views from UsedResource in descriptor_data #1325
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1325
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1325/head"
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?
@bartikele on GitHub · 2026-11-24 17:26 UTC · original
bartikele:shader-descriptor-only-as-data→main· +89 −38 · 1 files · 1 commits · closed without mergingIn
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 policy@shortselow-byte on GitHub · 2026-11-24 17:54 UTC · original
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.@bartikele on GitHub · 2026-11-24 18:02 UTC · original
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