shader: handle multi-descriptor wide loads and partial reloads in descriptor_data (#4) #457
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/457"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by lucasferreira1610 on 2026-11-27T20:53:35Z.
Refs #4
Summary
Fixes
"a descriptor's address or format read as data: a dword outside the descriptor"(3 compute shaders in the #4 refusal table) inLower::descriptor_data:s_load_dwordx8,s_load_dwordx16):Lower::load_usespreviously kept only the first(use_site, first)per scalar load, dropping any second descriptor loaded by the same instruction so its dwords fell past the first descriptor's range and were marked"a dword outside the descriptor".Lower::load_usesnow keeps every distinctfirstoffset per load, andLower::descriptor_datarebuilds each descriptor's queryable size/count dwords independently:getDimensionswhen at least one of their dwords is read outside resource descriptor operands, keeping DXIL output unchanged on shaders that do not read them as data.site's dword range (e.g.s_load_dwordat+8for a buffer's record count ors_load_dwordx4at+4for an image's size dwords within the same 32-byte slot),Lower::descriptor_datamatches it instead of falling through toview_addresses. Partial reloads that do not overlap any rebuilt size/count dword (such as a standalone+4dword-1 address-high-bits load) still pass through toview_addresses.docs/native-host.md.Verification
cargo test -p victory-shader(404 unit tests + 5 sweep tests passed, including new testswide_descriptor_load_rebuilds_each_descriptor_and_keeps_outside_refusedandpartial_reload_of_used_descriptor_size_dwords_translates)cargo test -p victory-hle --lib -p victory -p xtask(all passed)cargo clippy -p victory-shader --all-targets -- -D warnings(passed)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings(passed)cargo xtask policy(asset policy: 398 files ok)Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T00:37:15Z.
Review: CHANGES_REQUESTED
Thanks for this PR! We're helping the maintainer clear the queue tonight, and main has moved a lot (the preview branch landed as
86cefd22, then a batch of PRs; main is nowa6a58361). This branch now conflicts with main incrates/victory-shader/src/emit/lower.rs.Could you merge current
maininto the branch (a merge commit is fine, no need to rebase) and resolve the conflict? This one is in translator code, so please re-run the shader tests after the merge. Once GitHub shows it as mergeable and CI is green on the new head, we'll read it through and merge it if it holds up.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T00:46:55Z.
The maintainer is handling this one himself; please follow his lead rather than my review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.