shader(lower): store bit-assembled packed 4-channel texels via textureStore.i32 #259
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
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
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
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/Androtim--MiniVI!259
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/259/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?
@Androtim on GitHub · 2026-11-30 17:23 UTC · original
Androtim:feat/iter252-shader-packed-word-int-store→main· +93 −3 · 2 files · 1 commits · merged 2026-11-30 19:18 UTCSummary
packed_word) insideimage_storelowering (crates/victory-shader/src/emit/lower.rs) and emittextureStore.i32directly (sharing the integer store emission path with single-channel counter stores).R9G9B9E5texels written toR32_UINTviews) to zero on NVIDIA GPUs.a_packed_word_is_stored_bit_for_bitincrates/victory-shader/src/emit/size_tests.rsverifying bit-exact0x7F80_0001storage on hardware and WARP.Verification
cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib emit::size_tests::->9 passed; 0 failedcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib emit::lower->20 passed; 0 failed; 1 ignoredcargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings-> cleancargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings-> cleanlower.rs,size_tests.rs) introduce zeroxtask policyviolations; the onlyxtask policyviolation observed on this branch is the pre-existingcrates/victory-gpu/src/host.rssize limit onmain, which is resolved by the siblingchore/iter252-host-extract-refresh-testsPR.@Androtim on GitHub · 2026-11-30 18:03 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingAutomated Review — PR #259
Verdict:
needs-gpu-test(CI passing; logic and scoping look clean, warrants a local real-GPU smoke test).What was checked
crates/victory-shader/src/emit/lower.rs:Lower::packed_wordtracesv[reg..reg + 4]through up to 8v_mov_b32vector copies and matches when all 4 channels resolve to the same SSAValuewritten by one of the 7 bit-assembly VALU ops (v_or_b32,v_or3_b32,v_lshl_or_b32,v_and_or_b32,v_bfi_b32,v_perm_b32,v_alignbit_b32).image_storelowering unifies single-channel counter stores (0x105) and non-d16packed-word stores (0x405) ontotextureStore.i32(dx.op.textureStore.i32, opcode 67), avoiding float NaN canonicalization/flushing on integer views.crates/victory-shader/src/emit/size_tests.rs:a_packed_word_is_stored_bit_for_bitcovering av_or_b32-assembled signaling-NaN bit pattern (0x7F80_0001) broadcast acrossv[3:6]intoView::UintTextureUav(1, 1).Notes / Edge cases to watch during GPU testing
packed_wordinfers an integer UAV solely from the producing VALU op and 4-channel broadcast. If a shader computes a float viav_bfi_b32,v_or_b32, orv_and_or_b32(e.g., sign-bit manipulation or bit-select) and broadcasts it to all 4 channels of aFLOAT/UNORMUAV, emittingtextureStore.i32(0x405) would cause a format-family mismatch. A real-GPU smoke test across game scenes (and ideally with D3D12 debug layer enabled) will confirm no regressions.0x405(uint4) handle on 1-componentR32_UINTUAVs: Works insize_tests.rson WARP/hardware, but worth confirming clean behavior on real NVIDIA/AMD/Intel drivers alongsideR9G9B9E5/R32_UINTworkloads.v_mov_b32tracing inpacked_worddoes not inspectFields::Valumodifiers (e.g., DPP/SDWA if decoded under the same mnemonic), andwriterscansself.x.p.blockslinearly per lookup—fine for typical shader sizes, just worth keeping in mind.This is an automated review and does not constitute formal maintainer approval.
Generated with Antigravity CLI (
agy).@Androtim on GitHub · 2026-11-30 19:18 UTC · original
Hardware verification on RTX 4060 Ti (Series X 1440p parity, DLSS Quality, origin/main
440d7d7+ #259):