Shaders: use declared structured SRVs for scalar loads and record counts #995

Closed
jeremygold02 wants to merge 2 commits from upstream-pr/995 into main
jeremygold02 commented 2026-11-24 14:46:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T14:46:11Z.


Scalar s_buffer_load_dword* instructions use byte addresses. On ffe310e, a descriptor-table SRV takes the raw-buffer path even when the original shader declares a structured SRV. Reading descriptor word 2 (NUM_RECORDS) as ordinary data can also stop translation. Native stride alone cannot identify the view because a raw SRV can carry the same stride metadata.

This change checks the original PSV0 declaration and the exact, statically addressed native table slot. A unique, single-register structured SRV with a matching native binding uses structured addressing. Each dword of a wide load gets its own record index and byte offset, including when the load crosses a record boundary. A use of the record count as ordinary data or through a phi obtains it from GetDimensions. Loads that only need the descriptor handle omit that query. Raw, ambiguous, dynamically selected and mixed-consumer bindings keep their existing behavior.

Relationship to other PRs

#984, opened while this branch was being verified, also splits each scalar dword address and covers flat vector loads, stores and atomics. It selects the structured path from table binding and aligned stride. The scalar address arithmetic overlaps. This patch adds the declaration and slot check and recovers the consumed record count for that same structured SRV.

#136 demonstrated the structured scalar case using native stride. #329 recovers counts for descriptors with no tracked resource consumer. #437 preserves raw scalar loads, and #953 uses a raw view to query size for a scalar consumer. The case here reads an element count from a declared structured view and addresses each scalar dword within that view.

Verification

  • On the submitted revision against ffe310e, all five new regression tests and the upstream stencil-export test passed with Windows SDK 10.0.26100.0 dxil.dll. The broader victory-shader library run passed 103 tests, with one benchmark ignored and 22 GPU or differential cases filtered. cargo clippy --locked -p victory-shader --all-targets --all-features -- -D warnings passed.
  • On parent c2e7254, two vertex shaders failed on the scalar descriptor-data read. Both translated and passed SDK validation on 89b6c67. Each emitted one live count query and 21 dword loads split into record index and byte offset.
  • Four small dispatches on a physical RTX 5070 checked the words on either side of an 80-byte record boundary, a nonzero view start, a matching raw subview, and both outcomes of a count guard. All four fences completed and the output canaries were preserved. Revision 89b6c67 reproduced the three hardware-tested DXIL containers byte for byte.
  • An earlier comparison of the same change on d2a4bae covered 25,694 inputs. Fifteen additional shaders passed SDK validation and all 21,971 previously valid shaders still passed. The emitted code changed for 18,136 of those previously valid shaders.

Gameplay impact remains unverified.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6584433808 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T14:46:11Z. --- Scalar `s_buffer_load_dword*` instructions use byte addresses. On `ffe310e`, a descriptor-table SRV takes the raw-buffer path even when the original shader declares a structured SRV. Reading descriptor word 2 (`NUM_RECORDS`) as ordinary data can also stop translation. Native stride alone cannot identify the view because a raw SRV can carry the same stride metadata. This change checks the original `PSV0` declaration and the exact, statically addressed native table slot. A unique, single-register structured SRV with a matching native binding uses structured addressing. Each dword of a wide load gets its own record index and byte offset, including when the load crosses a record boundary. A use of the record count as ordinary data or through a phi obtains it from `GetDimensions`. Loads that only need the descriptor handle omit that query. Raw, ambiguous, dynamically selected and mixed-consumer bindings keep their existing behavior. ### Relationship to other PRs #984, opened while this branch was being verified, also splits each scalar dword address and covers flat vector loads, stores and atomics. It selects the structured path from table binding and aligned stride. The scalar address arithmetic overlaps. This patch adds the declaration and slot check and recovers the consumed record count for that same structured SRV. #136 demonstrated the structured scalar case using native stride. #329 recovers counts for descriptors with no tracked resource consumer. #437 preserves raw scalar loads, and #953 uses a raw view to query size for a scalar consumer. The case here reads an element count from a declared structured view and addresses each scalar dword within that view. ### Verification - On the submitted revision against `ffe310e`, all five new regression tests and the upstream stencil-export test passed with Windows SDK 10.0.26100.0 `dxil.dll`. The broader `victory-shader` library run passed 103 tests, with one benchmark ignored and 22 GPU or differential cases filtered. `cargo clippy --locked -p victory-shader --all-targets --all-features -- -D warnings` passed. - On parent `c2e7254`, two vertex shaders failed on the scalar descriptor-data read. Both translated and passed SDK validation on `89b6c67`. Each emitted one live count query and 21 dword loads split into record index and byte offset. - Four small dispatches on a physical RTX 5070 checked the words on either side of an 80-byte record boundary, a nonzero view start, a matching raw subview, and both outcomes of a count guard. All four fences completed and the output canaries were preserved. Revision `89b6c67` reproduced the three hardware-tested DXIL containers byte for byte. - An earlier comparison of the same change on `d2a4bae` covered 25,694 inputs. Fifteen additional shaders passed SDK validation and all 21,971 previously valid shaders still passed. The emitted code changed for 18,136 of those previously valid shaders. Gameplay impact remains unverified.
Zipettte commented 2026-11-24 15:04:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T14:54:52Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 78c8078: cargo test -p victory-shader passes, 125 passed / 0 failed. Workspace baseline on main (ffe310e) was green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135153963 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#issuecomment-7135153963). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T14:54:52Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 78c8078: `cargo test -p victory-shader` passes, 125 passed / 0 failed. Workspace baseline on main (ffe310e) was green on the same machine (342 passed). _Tested with AI assistance (Claude)._
catminou4 commented 2026-11-24 16:04:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T15:41:45Z.

Review: APPROVED


Using the declared structured SRV for scalar loads is implemented as a proof, not a heuristic: scalar_structured_stride requires the PSV bindings, an exact single table slot with no other consumers, exactly one matching used-resource entry (kind SRV, 4 dwords, stride 4..=2048 multiple of 4), and singleton_structured_srv on the lower bound — any doubt falls back to the old raw path. The raw-buffer side correctly splits the byte address into record index + within-record offset so wide loads crossing record boundaries land right. record_count_word conservatively bails on mixed consumers and phi-selected descriptors. The +251 lines of native tests plus the emit-side proof test back the guards.

Verified locally: test-merge with main (ffe310e) clean; cargo test -p victory-shader --locked (macOS arm64, rustc 1.98.1) → 101 passed / 0 failed / 1 ignored. Scope note: host-execution coverage of the new structured path is Windows-gated; macOS covers compilation and all unit tests. Approving.

<!-- greyfinch-sync:Marvisak/VIctory:review:6042461669 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#pullrequestreview-6042461669). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T15:41:45Z. **Review:** APPROVED --- Using the declared structured SRV for scalar loads is implemented as a proof, not a heuristic: `scalar_structured_stride` requires the PSV bindings, an exact single table slot with no other consumers, exactly one matching used-resource entry (kind SRV, 4 dwords, stride 4..=2048 multiple of 4), and `singleton_structured_srv` on the lower bound — any doubt falls back to the old raw path. The raw-buffer side correctly splits the byte address into record index + within-record offset so wide loads crossing record boundaries land right. `record_count_word` conservatively bails on mixed consumers and phi-selected descriptors. The +251 lines of native tests plus the emit-side proof test back the guards. Verified locally: test-merge with main (`ffe310e`) clean; `cargo test -p victory-shader --locked` (macOS arm64, rustc 1.98.1) → **101 passed / 0 failed / 1 ignored**. Scope note: host-execution coverage of the new structured path is Windows-gated; macOS covers compilation and all unit tests. Approving.
jeremygold02 commented 2026-11-24 16:05:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T15:47:10Z.


I compared the same two mission vertex shaders on Windows 11 with Windows SDK 10.0.26100.0. The draw-entry observations for the affected slot are in the earlier verification on #136.

Revision SDK-valid outputs Result for the affected 80-byte structured SRV
ffe310e (main) 0/2 Both stop at the scalar descriptor-data read.
c42cbb0 (#953) 2/2 Neither output queries dimensions on an 80-byte structured handle.
5011645 (#984) 0/2 Both stop at the same descriptor-data read as main.
78c8078 (this PR) 2/2 Each output queries the count once and splits all 21 dword loads from the same binding into record index and byte offset.

I also ran #984’s separate one-thread buffer-read regression on a physical RTX 5070. I restricted the test adapter loop to hardware and checked the device LUID’s adapter description before dispatch. Both scalar and flat vector reads returned the expected word at all nine offsets across three 56-byte records. That fixture covers a distinct case worth retaining alongside the count-consuming shaders here. The mission shaders were translated offline.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7136608409 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#issuecomment-7136608409). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T15:47:10Z. --- I compared the same two mission vertex shaders on Windows 11 with Windows SDK 10.0.26100.0. The draw-entry observations for the affected slot are in [the earlier verification on #136](https://github.com/Marvisak/VIctory/pull/136#issuecomment-7124448780). | Revision | SDK-valid outputs | Result for the affected 80-byte structured SRV | | --- | ---: | --- | | `ffe310e` (main) | 0/2 | Both stop at the scalar descriptor-data read. | | `c42cbb0` (#953) | 2/2 | Neither output queries dimensions on an 80-byte structured handle. | | `5011645` (#984) | 0/2 | Both stop at the same descriptor-data read as main. | | `78c8078` (this PR) | 2/2 | Each output queries the count once and splits all 21 dword loads from the same binding into record index and byte offset. | I also ran #984’s separate one-thread buffer-read regression on a physical RTX 5070. I restricted the test adapter loop to hardware and checked the device LUID’s adapter description before dispatch. Both scalar and flat vector reads returned the expected word at all nine offsets across three 56-byte records. That fixture covers a distinct case worth retaining alongside the count-consuming shaders here. The mission shaders were translated offline.
jtrudeau1530 commented 2026-11-24 17:04:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jtrudeau1530 on 2026-11-24T16:39:53Z.


Validated this exact change (78c8078a) locally on RX 7900 XT / RADV under Wine 11.18 and vkd3d-proton 3.2.0. The test base also contains the mapped-copy fix and #1056; no title-derived fixtures were used.

A synthetic scalar-buffer fixture passed 12 hardware dispatches with exact eight-word readbacks: stride 80, x2/x4 loads across record boundaries at byte offsets 76 and 156, a count-derived last-record address, both count-guard outcomes, and raw-buffer controls with the same native stride. Canary words remain intact. The raw count remains refused rather than being inferred from stride. Microsoft DXIL validator release 1.7.2308 was required and passed.

The identical declaration/count fixture on the test-only parent reproduces the original scalar-memory-read refusal; the patched candidate passes. This establishes those scalar cases, not full game correctness or performance.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7138017095 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#issuecomment-7138017095). Originally posted by [jtrudeau1530](https://github.com/jtrudeau1530) on 2026-11-24T16:39:53Z. --- Validated this exact change (78c8078a) locally on RX 7900 XT / RADV under Wine 11.18 and vkd3d-proton 3.2.0. The test base also contains the mapped-copy fix and #1056; no title-derived fixtures were used. A synthetic scalar-buffer fixture passed 12 hardware dispatches with exact eight-word readbacks: stride 80, x2/x4 loads across record boundaries at byte offsets 76 and 156, a count-derived last-record address, both count-guard outcomes, and raw-buffer controls with the same native stride. Canary words remain intact. The raw count remains refused rather than being inferred from stride. Microsoft DXIL validator release 1.7.2308 was required and passed. The identical declaration/count fixture on the test-only parent reproduces the original scalar-memory-read refusal; the patched candidate passes. This establishes those scalar cases, not full game correctness or performance.
Ctrl-Alt-Haze commented 2026-11-24 17:04:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Ctrl-Alt-Haze on 2026-11-24T16:51:20Z.


Independent verification at 78c8078 on Windows 11, RTX 5070 Ti (driver 32.0.16.2135) + WARP (VICTORY_D3D12_DEBUG=1), dxil.dll 1.8.2502.11, Rust 1.98.1 against upstream/main (ffe310eb):

  • Cleanly on ffe310eb; cargo xtask policy: 154 files ok; both clippy checks pass.
  • cargo test --workspace --locked: 347 passed, 0 failed, 6 ignored.
  • victory-shader --features host (VICTORY_D3D12_DEBUG=1, RTX 5070 Ti & VICTORY_WARP=1): 125 passed, 0 failed, 1 ignored (0 D3D12 debug errors/warnings).
  • victory-gpu --features diagnostics (VICTORY_D3D12_DEBUG=1, RTX 5070 Ti & VICTORY_D3D12_WARP=1): 53 passed, 0 failed, 1 ignored (0 D3D12 debug errors/warnings).
  • Zero unsafe added; PSV0 + unique static slot check + wide-load dword splitting avoids the raw bytes/4 NUM_RECORDS mismatch in #953 (note textual conflict with #953 in lower.rs — prefer #995).

AI-assisted verification on local RTX 5070 Ti + WARP; no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7138310655 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#issuecomment-7138310655). Originally posted by [Ctrl-Alt-Haze](https://github.com/Ctrl-Alt-Haze) on 2026-11-24T16:51:20Z. --- Independent verification at `78c8078` on **Windows 11**, **RTX 5070 Ti** (driver `32.0.16.2135`) + **WARP** (`VICTORY_D3D12_DEBUG=1`), **dxil.dll `1.8.2502.11`**, **Rust `1.98.1`** against `upstream/main` (`ffe310eb`): - Cleanly on `ffe310eb`; `cargo xtask policy`: `154 files ok`; both `clippy` checks pass. - `cargo test --workspace --locked`: **347 passed, 0 failed, 6 ignored**. - `victory-shader --features host` (`VICTORY_D3D12_DEBUG=1`, RTX 5070 Ti & `VICTORY_WARP=1`): **125 passed, 0 failed, 1 ignored** (0 D3D12 debug errors/warnings). - `victory-gpu --features diagnostics` (`VICTORY_D3D12_DEBUG=1`, RTX 5070 Ti & `VICTORY_D3D12_WARP=1`): **53 passed, 0 failed, 1 ignored** (0 D3D12 debug errors/warnings). - Zero `unsafe` added; `PSV0` + unique static slot check + wide-load dword splitting avoids the raw `bytes/4` `NUM_RECORDS` mismatch in `#953` (note textual conflict with `#953` in `lower.rs` — prefer `#995`). AI-assisted verification on local RTX 5070 Ti + WARP; no game data.
sinan-cmyk commented 2026-11-24 20:03:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-24T19:50:13Z.


Offline measurement on a retail dump, and the shader tests on Ada

Result: +15 programs over main, 0 lost.

Offline. I merged head 78c8078 onto main ffe310e (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 21,724 on main, 21,739 with this PR.

Failure on main Gained
emit: a scalar memory read as data 15

All 15 are among the programs that #1319 gains. Another 114 programs move from "a scalar memory read as data" on to "a descriptor's address or format read as data". That is the reason #1597 targets, and I'm measuring this PR stacked on #1597.

Tests: with the same merge, cargo test --locked -p victory-shader --lib passed 125, failed 0. The bitcode benchmark is ignored, as on main, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, with VICTORY_WARP unset.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7142657848 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#issuecomment-7142657848). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-24T19:50:13Z. --- ### Offline measurement on a retail dump, and the shader tests on Ada **Result: +15 programs over `main`, 0 lost.** **Offline.** I merged head 78c8078 onto `main` ffe310e (clean merge) and ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with `main` program by program (25,889 programs). Validated: 21,724 on `main`, 21,739 with this PR. | Failure on `main` | Gained | |---|---| | emit: a scalar memory read as data | 15 | All 15 are among the programs that #1319 gains. Another 114 programs move from "a scalar memory read as data" on to "a descriptor's address or format read as data". That is the reason #1597 targets, and I'm measuring this PR stacked on #1597. **Tests:** with the same merge, `cargo test --locked -p victory-shader --lib` passed 125, failed 0. The bitcode benchmark is ignored, as on `main`, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, with `VICTORY_WARP` unset. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
anlnimus commented 2026-11-24 21:03:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by anlnimus on 2026-11-24T20:33:41Z.


Hardware note from testing on AMD Radeon RX 6900 XT (RDNA2), Adrenalin driver 32.0.21045.16010, Windows 11 Pro (10.0.26200):

While verifying structured SRVs on hardware in a local integration build (#986 + #995-style lowering), reading a structured heap SRV (StructureByteStride > 0) through a raw DXIL ByteAddressBuffer handle returned all zeros on RX 6900 XT (even where WARP / NVIDIA tolerate the view/resource kind mismatch). Lowering scalar buffer loads on structured table SRVs with a matching StructuredBuffer handle ((12, stride) + UDiv/URem element indexing) returned the exact expected bytes on RX 6900 XT.

This directly supports #995's motivation on AMD RDNA2 hardware. (No game assets or dumps attached; tested with AI assistance.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7143733795 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#issuecomment-7143733795). Originally posted by [anlnimus](https://github.com/anlnimus) on 2026-11-24T20:33:41Z. --- Hardware note from testing on **AMD Radeon RX 6900 XT (RDNA2)**, Adrenalin driver `32.0.21045.16010`, Windows 11 Pro (`10.0.26200`): While verifying structured SRVs on hardware in a local integration build (`#986` + #995-style lowering), reading a structured heap SRV (`StructureByteStride > 0`) through a raw DXIL `ByteAddressBuffer` handle returned all zeros on RX 6900 XT (even where WARP / NVIDIA tolerate the view/resource kind mismatch). Lowering scalar buffer loads on structured table SRVs with a matching `StructuredBuffer` handle (`(12, stride)` + `UDiv`/`URem` element indexing) returned the exact expected bytes on RX 6900 XT. This directly supports #995's motivation on AMD RDNA2 hardware. (No game assets or dumps attached; tested with AI assistance.)
upstream-sync closed this pull request 2026-11-25 01:05:11 +00:00
Marvisak commented 2026-11-25 01:07:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:29:46Z.


Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Structured addressing for scalar loads chosen from PSV0, and record counts: main settled this the other way (scalar loads read raw views by byte address, emit/mod.rs notes) and reads record counts through getDimensions (75677cb8).

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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148568348 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#issuecomment-7148568348). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:29:46Z. --- Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Structured addressing for scalar loads chosen from PSV0, and record counts: main settled this the other way (scalar loads read raw views by byte address, emit/mod.rs notes) and reads record counts through getDimensions (75677cb8). 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.
sinan-cmyk commented 2026-11-25 02:06:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T01:45:48Z.


Stacked results

  • On #1402: 0 gained, 0 lost, and no failure reason changes. On main this PR gained 15 programs, and all of them are among #1319's gains (inside #1402).
  • On #1597: at first, this PR cost 21 programs. It turns some raw views into structured ones, and #1597 did not yet treat a structured view's dword 1 as hidden. #1597's commit cc7d30a fixes that. Measured on the base #1597 had before that commit, with only the one-line fix added, #995 is now +1, 0 lost on top of it.

The merge with #1402 conflicts in 4 hunks (emit/lower.rs, emit/mod.rs). In two places the intents contradict each other:

  1. On the scalar-load path, an SRV raw view takes this PR's structured stride when it is known. Otherwise #1402's raw or UAV choice applies.
  2. In #953's s_buffer_load arm, the view becomes structured if this PR's record-count and declaration conditions hold. Otherwise it stays #953's raw view.

This PR's test scalar_table_record_count_requires_an_exact_unambiguous_declaration expects a refusal, but with #953 the merge falls back to a raw view. I had to relax that test to merge. On the merge, cargo test --locked -p victory-shader --lib: 142 passed, 0 failed.

Method: victory translate --validate --list on shaders.rpf (1.0.2.1), dxil.dll 1.8.2502.11, compared program by program (25,889 programs). AI-assisted (Claude Code). No shader names or data are included, per the asset policy.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149927102 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/995#issuecomment-7149927102). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-25T01:45:48Z. --- ### Stacked results - **On #1402:** 0 gained, 0 lost, and no failure reason changes. On `main` this PR gained 15 programs, and all of them are among #1319's gains (inside #1402). - **On #1597:** at first, this PR cost 21 programs. It turns some raw views into structured ones, and #1597 did not yet treat a structured view's dword 1 as hidden. #1597's commit cc7d30a fixes that. Measured on the base #1597 had before that commit, with only the one-line fix added, #995 is now **+1, 0 lost** on top of it. The merge with #1402 conflicts in 4 hunks (`emit/lower.rs`, `emit/mod.rs`). In two places the intents contradict each other: 1. On the scalar-load path, an SRV raw view takes this PR's structured stride when it is known. Otherwise #1402's raw or UAV choice applies. 2. In #953's `s_buffer_load` arm, the view becomes structured if this PR's record-count and declaration conditions hold. Otherwise it stays #953's raw view. This PR's test `scalar_table_record_count_requires_an_exact_unambiguous_declaration` expects a refusal, but with #953 the merge falls back to a raw view. I had to relax that test to merge. On the merge, `cargo test --locked -p victory-shader --lib`: 142 passed, 0 failed. Method: `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), dxil.dll 1.8.2502.11, compared program by program (25,889 programs). AI-assisted (Claude Code). No shader names or data are included, per the asset policy.

Pull request closed

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
Marvisak/VIctory!995
No description provided.