Shaders: a packed word written to all four channels is stored as an integer #4003
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4003
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4003"
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?
@Saul5662 on GitHub · 2026-11-30 14:15 UTC · original
Saul5662:fix/packed-word-image-store→main· +82 −0 · 2 files · 1 commits · merged 2026-11-30 16:28 UTCWhat it changes
The TAA resolves (
TAA_Utilities:CS_SceneColorTemporalResolve*, e.g.b2b1ea29bc3987db, the dual-output DOF-aware one) pack R9G9B9E5 into an R32_UINT texture with integer ops (v_or3_b32,v_lshl_or_b32) and write the word to all four channels of animage_store. The lowering always emittedbitcast i32 -> floatplustextureStore.f32through a 4xF32 handle (propsfixed at0x409), so the word travelled as a float. On NVIDIA, words whose bits read as a NaN do not arrive intact:0x7F800001came back as0x7FC00001, and in the game's buffer they ended up 0.DepthOfField:CS_MainBlurand the tile composite (PS_CompositeIndirectDrawBlend) read that packed copy through the R9G9B9E5 view, so the opening cutscene showed black splotches on Lucia's hoodie wherever the colour's shared exponent and blue mantissa made a NaN bit pattern. Raw capture (VICTORY_DUMP_RAW): of 225,818 non-zero words in the packed texture, none had a NaN pattern; the 4,582 zero texels were exactly the splotches, and a neighbour estimate puts the NaN pattern 40x more often at the holes than elsewhere.This change: a store whose four channels are the same value assembled from bit fields (
v_or_b32,v_or3_b32,v_lshl_or_b32,v_and_or_b32,v_bfi_b32,v_perm_b32,v_alignbit_b32, followed throughv_mov_b32copies) is lowered astextureStore.i32through a 4xU32 handle (0x405), as the counter store already is. Other stores keep the float path. 144 of 25,693 programs translate differently: the TAA resolves, the screen-probe temporal resolves, water (transmission volumetrics, underwater mask, tessellation), voxelization and the terrain indirection remap.How it was tested
emit::size_tests::a_packed_word_is_stored_bit_for_bit: stores0x7F800001built withv_or_b32to all four channels of a uint texture and reads it back. Passes on the RTX 3060; with the change disabled it fails (0x7FC00001). The WARP run is skipped here (no SM 6.6 WARP device under Wine).cargo testpassed for the crates it touches:victory-shader --libunder Wine on the RTX 3060: 458 passed, 5 failed, 9 ignored. The 5 failures do not involve image stores and so cannot reach this change (filter3d_tests::by_hand_and_by_the_card_agree,opt::hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity,intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves,tests::stub_pipeline_is_created(vkd3d accepts the altered digest),valu_tests::whole_wave_sections_keep_rounding_mode_changes); they look specific to Wine/vkd3d on this card.cargo clippy -p victory-shaderreports four errors that are already onmain(lower/analysis.rs,lower.rsunused import,native.rsargument count), none in this change.Checked for overlap
AI use: Claude Code (Claude Opus 5.5) found the cause, wrote the change and the test, ran the checks and wrote this text. Label: [pr-fix].
🤖 Generated with Claude Code
@dyshay on GitHub · 2026-11-30 14:53 UTC · original
Merged for testing into our integration branch dyshay/VIctory-NVIDIA
janus-prs. Builds and the targeted CPU tests pass; a run on an RTX 4090 (Series S, hardware RT) is queued and I'll post the result here.