victory-shader: lower a16 biased image samples and sub-dword LDS access #996
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!996
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/996/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 14:47 UTC · original
bartikele:shader-a16-bias-and-lds-subdword→main· +166 −14 · 1 files · 5 commits · closed without mergingAdds DXIL lowering in \ictory-shader\ for:
Verified with \cargo clippy -p victory-shader --all-targets --locked -- -D warnings, \cargo test -p victory-shader --locked\ (122 passed), \cargo xtask policy, and \ictory translate --validate.
@Zipettte on GitHub · 2026-11-24 14:54 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
c188c02:cargo test -p victory-shaderpasses, 122 passed / 0 failed, includinglds_byte_and_half_read_write_lower. Workspace baseline on main (ffe310e) was green on the same machine (342 passed).Tested with AI assistance (Claude).
@bartikele on GitHub · 2026-11-24 17:18 UTC · original
Thanks @mercuryVM and @catminou4 for the thorough review! Updated
shader-a16-bias-and-lds-subdwordwith the following fixes:ds_read_{u8,i8,u16}_d16: now preserves bits31:16ofvdstviaself.low_half(inst, reg, r), matching the_hipath.a16image_sample_bbias: masks the bias VGPR to its low 16 bits (& 0xFFFF) and decodes it vialegacyF16ToF32(to_float) when*a16is set, and indexesbiasatusize::from(offset_word).firstnow usesname.starts_with("image_sample_b")to matchwhole.Regarding
@catminou4's note onds_write_b8/b16: DXILgroupshared uint[]has no byte-granular store intrinsic, soatomicAnd+atomicOris the closest lowering available today.Re-verified with
cargo clippy -p victory-shader --all-targets --locked -- -D warnings,cargo test -p victory-shader --locked, andcargo xtask policy.@bartikele on GitHub · 2026-11-24 20:40 UTC · original
Updated \ds_write_{b8,b16}{,_d16_hi}\ in \
@Marvisak on GitHub · 2026-11-25 00:29 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Both halves are in main: a16 biased samples (image()) and sub-dword LDS accesses (ds()).
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.
@bartikele on GitHub · 2026-11-25 13:21 UTC · original
Rebased onto current main (
940d32f), keeping main's image_bvh and 16 sample bias/offset handling while preserving the sub-dword LDS read/write lowering (ds_write_{b8,b16}{,d16_hi} via atomic cmpxchg loop and ds_read{u8,i8,u16,i16}{,_d16,_d16_hi}).Verified on
940d32f:Pull request closed