Shaders: five translation fixes from cool_fox and VIctory-NVIDIA-RT (image queries, scalar destinations, CalculateLOD on arrays, partial stores, LDS negated adds) #3064

Open
Adriwin06 wants to merge 7 commits from upstream-pr/3064 into main
Adriwin06 commented 2026-11-29 19:52:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-29T19:52:42Z.


What it changes

5 small changes of the same kind, one commit each, so each can be reviewed, reverted or left out on its own:

Shaders: an image query's unused extents read zero on non-cube views

The size query lowered every extent a view lacks (!present[ch]) to
one, the cube depth fallback. The console returns zero for a non-cube
view's unused extents, and a shader that multiplies or tests them saw
one instead. Only cube views (kind 5) still read one there.

Ported from DoubleGhosty/cool_fox@0e525f1 (Dathinel), GPL-3.0-or-later.

Shaders: a VALU scalar destination past the machine's registers is refused at decode

A VOP3 compare's mask, and v_readlane_b32's and v_readfirstlane_b32's
value, are an 8-bit scalar destination. No register has a code from 128
on (the SGPRs, VCC, the trap temporaries, M0, null and EXEC end at 127),
so a compiler never writes one, and the IR would take such a code for a
parked scalar's. Decoding now refuses the instruction with an ISA error
instead of translating it into a wrong program.

Test: gfx10::a_scalar_destination_past_the_registers_is_refused.

Ported from DoubleGhosty/cool_fox@200319b, GPL-3.0-or-later.

Shaders: CalculateLOD on a 1D or 2D array takes spatial coordinates only

The LOD query was given every coordinate of the sample, the array slice
included. CalculateLOD takes the spatial coordinates only; array
samples still need the slice, but the query now leaves that operand
undefined.

Tests: cube_lod_tests (array CalculateLOD).

Ported from Kemerd/VIctory-NVIDIA-RT@7526692, GPL-3.0-or-later.

Shaders: image and typed-buffer stores of fewer channels write the rest as zero

An image store whose dmask leaves channels out, and a typed buffer
store of fewer than four channels, were refused ("an image store of
some channels", "a typed buffer store of some channels or at an
offset"), so their programs did not translate. The console writes the
channels the mask leaves out, and those past a typed store's last, as
zero rather than keeping the texel's old values, so no read of the texel
is needed: they are now filled with zero (a d16 image store packs the
channels it does write two to a VGPR, as before). Still refused: an
image store of no channels, a partial store into a view the program
also counts in, and a typed store at an offset. Also adds a test for
s_pack_ll_b32_b16.

Tests: size_tests (zero-padded partial stores), valu_tests (s_pack_ll_b32_b16).

Ported from Kemerd/VIctory-NVIDIA-RT@6d9c88a, GPL-3.0-or-later.

Shaders: an LDS atomic add of a negated value is lowered so NVIDIA cannot fold it into a subtract

A group-shared atomic add of sub 0, x was emitted as written, and
NVIDIA's D3D12 compiler folds it back into a group-shared atomic
subtract, which it refuses (CreateComputePipelineState returns
E_OUTOFMEMORY, so the pipeline is never made). Such an add is now
written as an add of x * WaveReadLaneFirst(-1), which the compiler
cannot see through. Explicit ds_sub_u32 keeps its compare-exchange loop
(#1623).

Tests: emit::lds_sub_tests (hardware GPU; skipped where none is present).

Ported from DoubleGhosty/cool_fox@5b8e20c, GPL-3.0-or-later.

How it was tested

  • GPU and profile: RTX 4070 SUPER, Ryzen 7 5800X. Not measured in the title on these commits by themselves: they come from a fork of mine that carries them with the rest of this set, and the title ran there. What is below is the unit tests on this branch.
  • Before: n/a (no in-title measurement on this branch)
  • After: n/a
  • For shader changes, the wave sizes tested: the unit tests named in each commit (32- and 64-lane programs where they translate both)
  • cargo test passed for the crates it touches:
    • image-query-extents: yes, cargo test -p victory-shader --lib -- image size_tests: 10 passed
    • gfx10-scalar-dest: yes, cargo test -p victory-shader --lib -- gfx10::: 17 passed
    • calculate-lod-array: yes, cargo test -p victory-shader --lib -- cube_lod: 3 passed
    • partial-stores: yes, cargo test -p victory-shader --lib -- size_tests s_pack_ll: 10 passed
    • lds-negated-add: yes, cargo test -p victory-shader --lib -- lds_sub: 2 passed
  • cargo clippy --workspace --all-targets --locked: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself).
  • cargo xtask policy: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs).
  • With all eleven of my pull requests merged together: cargo clippy also with --all-features adds no finding, and cargo test --workspace --locked fails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, 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, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related:
    • image-query-extents: None found for image size queries of non-cube views.
    • gfx10-scalar-dest: None found for scalar destinations past the registers.
    • calculate-lod-array: #222 (merged) fixed CalculateLOD's array coordinates for the sample path; the LOD query itself still took the slice.
    • partial-stores: None found for zero-filled partial image or typed-buffer stores.
    • lds-negated-add: #1623 (merged) lowers ds_sub_u32 as a compare-exchange loop; this covers an add of a negated value, which #1623 does not see. #2358 (open) is about commutative LDS atomics in Wave32 regions, a different case.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5554483981 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3064). Originally posted by [Adriwin06](https://github.com/Adriwin06) on 2026-11-29T19:52:42Z. --- ## What it changes 5 small changes of the same kind, one commit each, so each can be reviewed, reverted or left out on its own: ### Shaders: an image query's unused extents read zero on non-cube views The size query lowered every extent a view lacks (`!present[ch]`) to one, the cube depth fallback. The console returns zero for a non-cube view's unused extents, and a shader that multiplies or tests them saw one instead. Only cube views (kind 5) still read one there. Ported from DoubleGhosty/cool_fox@0e525f1 (Dathinel), GPL-3.0-or-later. ### Shaders: a VALU scalar destination past the machine's registers is refused at decode A VOP3 compare's mask, and v_readlane_b32's and v_readfirstlane_b32's value, are an 8-bit scalar destination. No register has a code from 128 on (the SGPRs, VCC, the trap temporaries, M0, null and EXEC end at 127), so a compiler never writes one, and the IR would take such a code for a parked scalar's. Decoding now refuses the instruction with an ISA error instead of translating it into a wrong program. Test: gfx10::a_scalar_destination_past_the_registers_is_refused. Ported from DoubleGhosty/cool_fox@200319b, GPL-3.0-or-later. ### Shaders: CalculateLOD on a 1D or 2D array takes spatial coordinates only The LOD query was given every coordinate of the sample, the array slice included. CalculateLOD takes the spatial coordinates only; array samples still need the slice, but the query now leaves that operand undefined. Tests: cube_lod_tests (array CalculateLOD). Ported from Kemerd/VIctory-NVIDIA-RT@7526692, GPL-3.0-or-later. ### Shaders: image and typed-buffer stores of fewer channels write the rest as zero An image store whose dmask leaves channels out, and a typed buffer store of fewer than four channels, were refused ("an image store of some channels", "a typed buffer store of some channels or at an offset"), so their programs did not translate. The console writes the channels the mask leaves out, and those past a typed store's last, as zero rather than keeping the texel's old values, so no read of the texel is needed: they are now filled with zero (a d16 image store packs the channels it does write two to a VGPR, as before). Still refused: an image store of no channels, a partial store into a view the program also counts in, and a typed store at an offset. Also adds a test for s_pack_ll_b32_b16. Tests: size_tests (zero-padded partial stores), valu_tests (s_pack_ll_b32_b16). Ported from Kemerd/VIctory-NVIDIA-RT@6d9c88a, GPL-3.0-or-later. ### Shaders: an LDS atomic add of a negated value is lowered so NVIDIA cannot fold it into a subtract A group-shared atomic add of `sub 0, x` was emitted as written, and NVIDIA's D3D12 compiler folds it back into a group-shared atomic subtract, which it refuses (CreateComputePipelineState returns E_OUTOFMEMORY, so the pipeline is never made). Such an add is now written as an add of `x * WaveReadLaneFirst(-1)`, which the compiler cannot see through. Explicit ds_sub_u32 keeps its compare-exchange loop (#1623). Tests: emit::lds_sub_tests (hardware GPU; skipped where none is present). Ported from DoubleGhosty/cool_fox@5b8e20c, GPL-3.0-or-later. ## How it was tested - GPU and profile: RTX 4070 SUPER, Ryzen 7 5800X. Not measured in the title on these commits by themselves: they come from a fork of mine that carries them with the rest of this set, and the title ran there. What is below is the unit tests on this branch. - Before: n/a (no in-title measurement on this branch) - After: n/a - For shader changes, the wave sizes tested: the unit tests named in each commit (32- and 64-lane programs where they translate both) - `cargo test` passed for the crates it touches: - image-query-extents: yes, `cargo test -p victory-shader --lib -- image size_tests`: 10 passed - gfx10-scalar-dest: yes, `cargo test -p victory-shader --lib -- gfx10::`: 17 passed - calculate-lod-array: yes, `cargo test -p victory-shader --lib -- cube_lod`: 3 passed - partial-stores: yes, `cargo test -p victory-shader --lib -- size_tests s_pack_ll`: 10 passed - lds-negated-add: yes, `cargo test -p victory-shader --lib -- lds_sub`: 2 passed - `cargo clippy --workspace --all-targets --locked`: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself). - `cargo xtask policy`: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs). - With all eleven of my pull requests merged together: `cargo clippy` also with `--all-features` adds no finding, and `cargo test --workspace --locked` fails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, 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, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: - image-query-extents: None found for image size queries of non-cube views. - gfx10-scalar-dest: None found for scalar destinations past the registers. - calculate-lod-array: #222 (merged) fixed CalculateLOD's array coordinates for the sample path; the LOD query itself still took the slice. - partial-stores: None found for zero-filled partial image or typed-buffer stores. - lds-negated-add: #1623 (merged) lowers ds_sub_u32 as a compare-exchange loop; this covers an add of a negated value, which #1623 does not see. #2358 (open) is about commutative LDS atomics in Wave32 regions, a different case. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copilot commented 2026-11-29 19:56:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Copilot on 2026-11-29T19:56:58Z.

Code review location: crates/victory-shader/src/emit/lower.rs; line 12013

@@ -11990,12 +12006,15 @@ impl<'a> Lower<'a> {
             if name != "image_store" {
                 return Err("an image store to a mip level");
             }
-            // shortcut: stores are taken to write all four channels of a
-            // float format (the console converts by the view's format).
-            // One channel goes into a view the program also counts in.
+            // shortcut: stores are taken to write a float format (the console
+            // converts by the view's format). One channel goes into a view
+            // the program also counts in.
             let counter = *dmask == 1 && self.is_counter(src);
-            if *dmask != 0xF && !counter {
-                return Err("an image store of some channels");
+            if !counter && *dmask == 0 {

The no-channel rejection is unreachable: line 11839 changes every zero dmask to 1 before this branch. Consequently, a zero-mask image_store now translates as an X-only store and clears Y/Z/W, or takes the counter-store path, instead of being refused. Check the original mask from inst.fields here, while preserving zero-mask normalization for loads and samples.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review-comment:4732925244 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3064#discussion_r4732925244). Originally posted by [Copilot](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-29T19:56:58Z. **Code review location:** `crates/victory-shader/src/emit/lower.rs`; line 12013 ~~~~diff @@ -11990,12 +12006,15 @@ impl<'a> Lower<'a> { if name != "image_store" { return Err("an image store to a mip level"); } - // shortcut: stores are taken to write all four channels of a - // float format (the console converts by the view's format). - // One channel goes into a view the program also counts in. + // shortcut: stores are taken to write a float format (the console + // converts by the view's format). One channel goes into a view + // the program also counts in. let counter = *dmask == 1 && self.is_counter(src); - if *dmask != 0xF && !counter { - return Err("an image store of some channels"); + if !counter && *dmask == 0 { ~~~~ --- The no-channel rejection is unreachable: line 11839 changes every zero dmask to 1 before this branch. Consequently, a zero-mask image_store now translates as an X-only store and clears Y/Z/W, or takes the counter-store path, instead of being refused. Check the original mask from inst.fields here, while preserving zero-mask normalization for loads and samples.
Copilot commented 2026-11-29 19:56:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Copilot on 2026-11-29T19:56:58Z.

Code review location: crates/victory-shader/src/emit/lower.rs; line 13159

@@ -13119,16 +13155,20 @@ impl<'a> Lower<'a> {
             }
             let mut args = Vec::new();
             let (op, name) = if typed {
-                // shortcut: typed stores are taken to write all four channels
-                // of a float format.
-                if count != 4 || *offen || *offset != 0 {
-                    return Err("a typed buffer store of some channels or at an offset");
+                // shortcut: typed stores are taken to write a float format.
+                if *offen || *offset != 0 {

The newly accepted partial typed stores can still have a byte offset even when offen is false and the instruction offset is zero: soffset and built_offset(src) contribute to off above. This path discards off and passes only index to bufferStore, so such a store silently writes the wrong element rather than being refused. Extend the offset rejection to scalar and descriptor-derived offsets, or correctly incorporate the complete byte address into the typed element index.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review-comment:4732925283 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3064#discussion_r4732925283). Originally posted by [Copilot](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-29T19:56:58Z. **Code review location:** `crates/victory-shader/src/emit/lower.rs`; line 13159 ~~~~diff @@ -13119,16 +13155,20 @@ impl<'a> Lower<'a> { } let mut args = Vec::new(); let (op, name) = if typed { - // shortcut: typed stores are taken to write all four channels - // of a float format. - if count != 4 || *offen || *offset != 0 { - return Err("a typed buffer store of some channels or at an offset"); + // shortcut: typed stores are taken to write a float format. + if *offen || *offset != 0 { ~~~~ --- The newly accepted partial typed stores can still have a byte offset even when `offen` is false and the instruction offset is zero: `soffset` and `built_offset(src)` contribute to `off` above. This path discards `off` and passes only `index` to `bufferStore`, so such a store silently writes the wrong element rather than being refused. Extend the offset rejection to scalar and descriptor-derived offsets, or correctly incorporate the complete byte address into the typed element index.
copilot-pull-request-reviewer[bot] commented 2026-11-29 19:56:59 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-29T19:56:59Z.

Review: COMMENTED


Zero-mask image stores bypass rejection and can clear unintended channels, while partial typed stores ignore scalar and descriptor-derived byte offsets and may write to the wrong element.

2 open issues
What changed in this PR

Ports five fixes into the RDNA2-to-DXIL shader translator, improving instruction validation, texture operations, and NVIDIA pipeline compatibility.

Changes:

  • Rejects out-of-range scalar destinations and corrects unused image-query extents.
  • Uses spatial coordinates for array LOD queries and zero-fills omitted store channels.
  • Adds a workaround for negated LDS atomic adds, plus targeted regression tests.
File Description
crates/​victory-shader/​src/​gfx10/​mod.rs Validates scalar destinations during decoding and adds tests.
crates/​victory-shader/​src/​emit/​valu_tests.rs Tests scalar packing and partial typed-buffer stores.
crates/​victory-shader/​src/​emit/​size_tests.rs Tests sparse and packed image-store zero filling.
crates/​victory-shader/​src/​emit/​mod.rs Registers Windows-only LDS subtraction tests.
crates/​victory-shader/​src/​emit/​lower.rs Implements image, LOD, partial-store, and LDS lowering changes.
crates/​victory-shader/​src/​emit/​lds_sub_tests.rs Checks hardware pipeline creation and atomic return values.
crates/​victory-shader/​src/​emit/​cube_lod_tests.rs Adds DXIL validation tests for array LOD queries.
crates/​victory-shader/​src/​emit/​bitcode.rs Recognizes integer negation for the LDS workaround.

Review effort: Balanced

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6104535460 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3064#pullrequestreview-6104535460). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-29T19:56:59Z. **Review:** COMMENTED --- <!-- ccr-overview-v2 --> ### 🟡 Changes recommended Zero-mask image stores bypass rejection and can clear unintended channels, while partial typed stores ignore scalar and descriptor-derived byte offsets and may write to the wrong element. <details open> <summary><strong>2 open issues</strong></summary> - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Check the original mask before rejecting zero-mask stores](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3064#discussion_r4732925244) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Preserve scalar and descriptor offsets in partial typed stores](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3064#discussion_r4732925283) · New </details> <details> <summary><strong>What changed in this PR</strong></summary> Ports five fixes into the RDNA2-to-DXIL shader translator, improving instruction validation, texture operations, and NVIDIA pipeline compatibility. **Changes:** - Rejects out-of-range scalar destinations and corrects unused image-query extents. - Uses spatial coordinates for array LOD queries and zero-fills omitted store channels. - Adds a workaround for negated LDS atomic adds, plus targeted regression tests. | File | Description | | ---- | ----------- | | `crates/​victory-shader/​src/​gfx10/​mod.rs` | Validates scalar destinations during decoding and adds tests. | | `crates/​victory-shader/​src/​emit/​valu_tests.rs` | Tests scalar packing and partial typed-buffer stores. | | `crates/​victory-shader/​src/​emit/​size_tests.rs` | Tests sparse and packed image-store zero filling. | | `crates/​victory-shader/​src/​emit/​mod.rs` | Registers Windows-only LDS subtraction tests. | | `crates/​victory-shader/​src/​emit/​lower.rs` | Implements image, LOD, partial-store, and LDS lowering changes. | | `crates/​victory-shader/​src/​emit/​lds_sub_tests.rs` | Checks hardware pipeline creation and atomic return values. | | `crates/​victory-shader/​src/​emit/​cube_lod_tests.rs` | Adds DXIL validation tests for array LOD queries. | | `crates/​victory-shader/​src/​emit/​bitcode.rs` | Recognizes integer negation for the LDS workaround. | </details> <sub>Review effort: Balanced</sub>
Adriwin06 commented 2026-11-30 01:10:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-30T01:10:11Z.

Code review location: crates/victory-shader/src/emit/lower.rs; line 12013

@@ -11990,12 +12006,15 @@ impl<'a> Lower<'a> {
             if name != "image_store" {
                 return Err("an image store to a mip level");
             }
-            // shortcut: stores are taken to write all four channels of a
-            // float format (the console converts by the view's format).
-            // One channel goes into a view the program also counts in.
+            // shortcut: stores are taken to write a float format (the console
+            // converts by the view's format). One channel goes into a view
+            // the program also counts in.
             let counter = *dmask == 1 && self.is_counter(src);
-            if *dmask != 0xF && !counter {
-                return Err("an image store of some channels");
+            if !counter && *dmask == 0 {

Good catch, fixed in 58173c40: the store branch now checks the instruction's own mask (no_channels, taken before the normalisation), so a dmask-0 image_store is refused. Loads and samples still treat 0 as 1. Regression test: an_image_store_of_no_channels_is_refused.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review-comment:4734086993 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3064#discussion_r4734086993). Originally posted by [Adriwin06](https://github.com/Adriwin06) on 2026-11-30T01:10:11Z. **Code review location:** `crates/victory-shader/src/emit/lower.rs`; line 12013 ~~~~diff @@ -11990,12 +12006,15 @@ impl<'a> Lower<'a> { if name != "image_store" { return Err("an image store to a mip level"); } - // shortcut: stores are taken to write all four channels of a - // float format (the console converts by the view's format). - // One channel goes into a view the program also counts in. + // shortcut: stores are taken to write a float format (the console + // converts by the view's format). One channel goes into a view + // the program also counts in. let counter = *dmask == 1 && self.is_counter(src); - if *dmask != 0xF && !counter { - return Err("an image store of some channels"); + if !counter && *dmask == 0 { ~~~~ --- Good catch, fixed in 58173c40: the store branch now checks the instruction's own mask (`no_channels`, taken before the normalisation), so a dmask-0 `image_store` is refused. Loads and samples still treat 0 as 1. Regression test: `an_image_store_of_no_channels_is_refused`.
Adriwin06 commented 2026-11-30 01:10:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-30T01:10:14Z.

Code review location: crates/victory-shader/src/emit/lower.rs; line 13159

@@ -13119,16 +13155,20 @@ impl<'a> Lower<'a> {
             }
             let mut args = Vec::new();
             let (op, name) = if typed {
-                // shortcut: typed stores are taken to write all four channels
-                // of a float format.
-                if count != 4 || *offen || *offset != 0 {
-                    return Err("a typed buffer store of some channels or at an offset");
+                // shortcut: typed stores are taken to write a float format.
+                if *offen || *offset != 0 {

Fixed in 99cfa483: a typed store of fewer than four channels is now refused unless the whole byte offset off is the constant 0. That covers a scalar soffset and the descriptor's base as well as offen/offset. An inline-0 soffset is still no offset, and four-channel stores keep their old rule. Regression test: typed_stores_of_some_channels_at_a_scalar_offset_are_refused (inline 0 accepted, s20 refused).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review-comment:4734087117 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3064#discussion_r4734087117). Originally posted by [Adriwin06](https://github.com/Adriwin06) on 2026-11-30T01:10:14Z. **Code review location:** `crates/victory-shader/src/emit/lower.rs`; line 13159 ~~~~diff @@ -13119,16 +13155,20 @@ impl<'a> Lower<'a> { } let mut args = Vec::new(); let (op, name) = if typed { - // shortcut: typed stores are taken to write all four channels - // of a float format. - if count != 4 || *offen || *offset != 0 { - return Err("a typed buffer store of some channels or at an offset"); + // shortcut: typed stores are taken to write a float format. + if *offen || *offset != 0 { ~~~~ --- Fixed in 99cfa483: a typed store of fewer than four channels is now refused unless the whole byte offset `off` is the constant 0. That covers a scalar `soffset` and the descriptor's base as well as `offen`/`offset`. An inline-0 `soffset` is still no offset, and four-channel stores keep their old rule. Regression test: `typed_stores_of_some_channels_at_a_scalar_offset_are_refused` (inline 0 accepted, `s20` refused).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3064:upstream-pr/3064'
git switch 'upstream-pr/3064'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/3064'
git switch 'upstream-pr/3064'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3064'
git switch 'upstream-pr/3064'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3064'
git switch 'main'
git merge --squash 'upstream-pr/3064'
git switch 'main'
git merge --ff-only 'upstream-pr/3064'
git switch 'main'
git merge 'upstream-pr/3064'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!3064
No description provided.