Shaders: a vertex program writing through views declares UAVs at every stage #1987

Closed
BastienRodz wants to merge 1 commit from upstream-pr/1989 into main
BastienRodz commented 2026-11-25 02:27:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T02:27:42Z.


What's wrong

Since cd94d35 ("GPU: shaders mark the pages they write through views; copy-backs compare only those"), translated shaders built with emit::Options::view_marks declare the view-write bitmap (u1 in MEMORY_SPACE, a raw root UAV in dx.resources) whenever they store or perform atomics through unordered buffer views. That includes vertex programs.

DXIL requires any non-pixel, non-compute shader that declares UAVs to set the UAVsAtEveryStage shader flag and the matching SFI0 feature bit. Because victory-shader did not set either bit, the DXIL validator recomputed the flags from the module and rejected those vertex modules with Flags must match usage. (#1973, 867 vertex programs in the reporter's offline check with dxil.dll 1.8.2502).

What the fix does

  • Adds flags::UAVS_AT_EVERY_STAGE = 1 << 16 in crates/victory-shader/src/emit/shader.rs, matching m_UAVsAtEveryStage at bit 16 in DXC's include/dxc/DXIL/DxilShaderFlags.h (lines 264-265).
  • In Shader::finish, sets flags::UAVS_AT_EVERY_STAGE whenever the stage is neither pixel nor compute (graphics && !self.pixel, covering vertex, geometry, and mesh shaders) and dx.resources declares any UAV (!self.root_uavs.is_empty() || self.memory_dirty.is_some() || self.view_writes.is_some()). This matches DXC's DxilModule::CollectShaderFlagsForModule in lib/DXIL/DxilModule.cpp (lines 318-350): because victory-shader declares dx.valver (1, 6) (< 1.8), DXC sets UAVsAtEveryStage whenever NumUAVs && !(SM->IsCS() || SM->IsPS()).
  • Maps flags::UAVS_AT_EVERY_STAGE to 0x4 in the SFI0 feature word, matching ShaderFeatureInfo_UAVsAtEveryStage = 0x0004 in DXC's include/dxc/DXIL/DxilConstants.h (line 2276) and ShaderFlags::GetFeatureInfo in lib/DXIL/DxilShaderFlags.cpp (lines 85-86).
  • Adds a synthetic unit test (emit::tests::vertex_uav_writes_declare_uavs_at_every_stage) checking SFI0, the serialized dx.entryPoints shader flags, and dxil.dll validation (when available) for vertex and mesh programs with view_marks, vertex programs without declared UAVs, and pixel and compute programs with view_marks.

Tests

  • Failure on origin/main (940d32f): the new unit test failed before the fix with:
    assertion left != right failed: VS SFI0 0x2000000: missing UAVsAtEveryStage
  • Local (Linux cross-compiling to x86_64-pc-windows-msvc, tests under Wine, no SM 6.6 device / no dxil.dll):
    • cargo xwin test -p victory-shader --target x86_64-pc-windows-msvc -- --test-threads=1: 173 passed, 75 failed, 3 ignored (vs 172 passed, 75 failed, 3 ignored on origin/main; only difference is the new test passing, and all 75 failures are the same SM 6.6 device tests under Wine).
    • cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: pass.
    • cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings: pass.
    • cargo xtask policy: pass (182 files ok).
  • Windows CI run: On GitHub's windows-latest (which has dxil.dll) with the upstream CI's commands, everything passes; victory-shader 248 passed, 0 failed, including the new test: https://github.com/BastienRodz/VIctory/actions/runs/45532795156

On the title's shaders (@zed6000, comment): translate --validate over the retail shader pack with dxil.dll 1.8.2502 gives 23,918 validated on main 940d32f and 24,785 with this PR, +867 and 0 lost. That is identical, program by program, to ccfb029 before cd94d35, and no program is left with "Flags must match usage".

Fixes #1973. Same report: #1987.

No game data used. AI-assisted: implemented with Gemini 4 Neon, reviewed and verified with Claude Code.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6595773883 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-25T02:27:42Z. --- ## What's wrong Since `cd94d35` ("GPU: shaders mark the pages they write through views; copy-backs compare only those"), translated shaders built with `emit::Options::view_marks` declare the view-write bitmap (`u1` in `MEMORY_SPACE`, a raw root UAV in `dx.resources`) whenever they store or perform atomics through unordered buffer views. That includes vertex programs. DXIL requires any non-pixel, non-compute shader that declares UAVs to set the `UAVsAtEveryStage` shader flag and the matching `SFI0` feature bit. Because `victory-shader` did not set either bit, the DXIL validator recomputed the flags from the module and rejected those vertex modules with `Flags must match usage.` (#1973, 867 vertex programs in the reporter's offline check with `dxil.dll` 1.8.2502). ## What the fix does - Adds `flags::UAVS_AT_EVERY_STAGE = 1 << 16` in `crates/victory-shader/src/emit/shader.rs`, matching `m_UAVsAtEveryStage` at bit 16 in DXC's `include/dxc/DXIL/DxilShaderFlags.h` (lines 264-265). - In `Shader::finish`, sets `flags::UAVS_AT_EVERY_STAGE` whenever the stage is neither pixel nor compute (`graphics && !self.pixel`, covering vertex, geometry, and mesh shaders) and `dx.resources` declares any UAV (`!self.root_uavs.is_empty() || self.memory_dirty.is_some() || self.view_writes.is_some()`). This matches DXC's `DxilModule::CollectShaderFlagsForModule` in `lib/DXIL/DxilModule.cpp` (lines 318-350): because `victory-shader` declares `dx.valver` `(1, 6)` (`< 1.8`), DXC sets `UAVsAtEveryStage` whenever `NumUAVs && !(SM->IsCS() || SM->IsPS())`. - Maps `flags::UAVS_AT_EVERY_STAGE` to `0x4` in the `SFI0` feature word, matching `ShaderFeatureInfo_UAVsAtEveryStage = 0x0004` in DXC's `include/dxc/DXIL/DxilConstants.h` (line 2276) and `ShaderFlags::GetFeatureInfo` in `lib/DXIL/DxilShaderFlags.cpp` (lines 85-86). - Adds a synthetic unit test (`emit::tests::vertex_uav_writes_declare_uavs_at_every_stage`) checking `SFI0`, the serialized `dx.entryPoints` shader flags, and `dxil.dll` validation (when available) for vertex and mesh programs with `view_marks`, vertex programs without declared UAVs, and pixel and compute programs with `view_marks`. ## Tests - Failure on `origin/main` (`940d32f`): the new unit test failed before the fix with: `assertion left != right failed: VS SFI0 0x2000000: missing UAVsAtEveryStage` - Local (Linux cross-compiling to `x86_64-pc-windows-msvc`, tests under Wine, no SM 6.6 device / no `dxil.dll`): - `cargo xwin test -p victory-shader --target x86_64-pc-windows-msvc -- --test-threads=1`: 173 passed, 75 failed, 3 ignored (vs 172 passed, 75 failed, 3 ignored on `origin/main`; only difference is the new test passing, and all 75 failures are the same SM 6.6 device tests under Wine). - `cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings`: pass. - `cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings`: pass. - `cargo xtask policy`: pass (`182 files ok`). - Windows CI run: On GitHub's `windows-latest` (which has `dxil.dll`) with the upstream CI's commands, everything passes; `victory-shader` 248 passed, 0 failed, including the new test: https://github.com/BastienRodz/VIctory/actions/runs/45532795156 **On the title's shaders** (@zed6000, [comment](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7150893767)): `translate --validate` over the retail shader pack with dxil.dll 1.8.2502 gives 23,918 validated on `main` `940d32f` and 24,785 with this PR, +867 and 0 lost. That is identical, program by program, to `ccfb029` before `cd94d35`, and no program is left with "Flags must match usage". Fixes #1973. Same report: #1987. No game data used. AI-assisted: implemented with Gemini 4 Neon, reviewed and verified with Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
catminou4 commented 2026-11-25 03:03:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:56:50Z.

Review: APPROVED


Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, cargo test -p victory-shader --locked.

145 passed / 0 failed / 2 ignored. Vertex program writing through views declares UAVs at every stage (+1 test). Duplicate/overlap with #1977 — maintainer should pick one; this one covers the 'writing through views' case explicitly.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051183401 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#pullrequestreview-6051183401). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T02:56:50Z. **Review:** APPROVED --- Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, `cargo test -p victory-shader --locked`. 145 passed / 0 failed / 2 ignored. Vertex program writing through views declares UAVs at every stage (+1 test). **Duplicate/overlap with #1977** — maintainer should pick one; this one covers the 'writing through views' case explicitly.
DesertGamer commented 2026-11-25 03:03:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-25T02:28:23Z.


VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150767429 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7150767429). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-25T02:28:23Z. --- ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
zed6000 commented 2026-11-25 03:03:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zed6000 on 2026-11-25T02:34:16Z.


Confirmed on the title's shaders, as asked in #1973. Head 0f11320, merged onto main 940d32f (a clean merge), measured with victory translate --validate --list over shaders.rpf (1.0.2.1, dxil.dll 1.8.2502) and compared program by program:

Build Validated Change
main 940d32f 23,918
940d32f + this PR 24,785 +867, 0 lost
compared with ccfb029, before cd94d35 0 gained, 0 lost: identical

No program is left with "Flags must match usage". cargo test -p victory-shader --lib gives 248 passed and 0 failed on an RX 7900 XTX (RDNA3). Your version also flags mesh programs with UAVs, which my patch in #1973 didn't; on this data both give the same result. Offline counts only; no program names or data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150893767 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7150893767). Originally posted by [zed6000](https://github.com/zed6000) on 2026-11-25T02:34:16Z. --- Confirmed on the title's shaders, as asked in #1973. Head `0f11320`, merged onto main `940d32f` (a clean merge), measured with `victory translate --validate --list` over `shaders.rpf` (1.0.2.1, dxil.dll 1.8.2502) and compared program by program: | Build | Validated | Change | |---|---|---| | main `940d32f` | 23,918 | | | `940d32f` + this PR | **24,785** | **+867, 0 lost** | | compared with `ccfb029`, before `cd94d35` | | 0 gained, 0 lost: identical | No program is left with "Flags must match usage". `cargo test -p victory-shader --lib` gives 248 passed and 0 failed on an RX 7900 XTX (RDNA3). Your version also flags mesh programs with UAVs, which my patch in #1973 didn't; on this data both give the same result. Offline counts only; no program names or data.
Calvix2k commented 2026-11-25 03:03:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T02:38:49Z.


Confirming this as the one to merge for #1973 (I closed my #1977 in its favour after @Dathinel's mesh fixture showed my stage predicate still failed the mesh case and yours passes it).

The corpus result applies to this head too: zed6000 and @sinan-cmyk both measured main 940d32f 23,918 → 24,785 validated (+867, 0 lost) on 25,889 programs with the same two bits. I ran this branch's test locally on Windows 10 / RX 7800 XT: vertex_uav_writes_declare_uavs_at_every_stage passes, and the mesh finding above is the reason to prefer it over mine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150994642 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7150994642). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T02:38:49Z. --- Confirming this as the one to merge for #1973 (I closed my #1977 in its favour after @Dathinel's mesh fixture showed my stage predicate still failed the mesh case and yours passes it). The corpus result applies to this head too: zed6000 and @sinan-cmyk both measured `main 940d32f` 23,918 → **24,785 validated (+867, 0 lost)** on 25,889 programs with the same two bits. I ran this branch's test locally on Windows 10 / RX 7800 XT: `vertex_uav_writes_declare_uavs_at_every_stage` passes, and the mesh finding above is the reason to prefer it over mine.
BaggyALPHA commented 2026-11-25 03:03:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BaggyALPHA on 2026-11-25T02:53:53Z.


Independent native Windows validation of 0f11320 on upstream 940d32f. I made validator loading mandatory in the local synthetic test so a skipped validator could not produce a pass.

  • With the PR, all five cases in vertex_uav_writes_declare_uavs_at_every_stage validated with both official DXC 1.7 and 1.8. The SFI0 and dx.entryPoints assertions passed as well.
  • With upstream metadata generation restored and the same test run on DXC 1.8, the vertex program with view marking failed with Flags must match usage. It passed again with the PR's metadata.

This verifies the focused synthetic cases, including mesh and the pixel/compute controls. No game files or title corpus were used. AI-assisted (OpenAI Codex).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151329887 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7151329887). Originally posted by [BaggyALPHA](https://github.com/BaggyALPHA) on 2026-11-25T02:53:53Z. --- Independent native Windows validation of `0f11320` on upstream `940d32f`. I made validator loading mandatory in the local synthetic test so a skipped validator could not produce a pass. - With the PR, all five cases in `vertex_uav_writes_declare_uavs_at_every_stage` validated with both official DXC 1.7 and 1.8. The SFI0 and `dx.entryPoints` assertions passed as well. - With upstream metadata generation restored and the same test run on DXC 1.8, the vertex program with view marking failed with `Flags must match usage`. It passed again with the PR's metadata. This verifies the focused synthetic cases, including mesh and the pixel/compute controls. No game files or title corpus were used. AI-assisted (OpenAI Codex).
upipibi commented 2026-11-25 03:03:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T03:00:15Z.


Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at 0f11320. victory-shader: 245 passed, 3 failed, 3 ignored. The 3 are #1744's NVIDIA failures on main (the two stride_tests heap-buffer reads and gathers_at_a_level_match_the_hardware). Same as main on this hardware. Not run: a title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151489623 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7151489623). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T03:00:15Z. --- Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at `0f11320`. `victory-shader`: 245 passed, 3 failed, 3 ignored. The 3 are #1744's NVIDIA failures on `main` (the two `stride_tests` heap-buffer reads and `gathers_at_a_level_match_the_hardware`). Same as `main` on this hardware. Not run: a title. AI-assisted (Claude Code).
AgneyaK commented 2026-11-25 04:06:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AgneyaK on 2026-11-25T03:17:55Z.


An independent full-corpus run of this PR: offline victory translate --validate over the title 1.0.2.1's shader pack, release builds, Windows 11 26300. The validator is the SDK 10.0.26100.0\x64\dxil.dll, which on this machine is DXC 1.9.2602 (serviced; IDxcVersionInfo reports 1.9). This PR (0f11320) is a fast-forward of main 940d32f.

vertex + pixel validated compute validated mesh validated Flags must match usage
main 940d32f 13,350 of 14,217 emitted 1,961 of 2,696 8,694 of 8,765 867
this PR 14,217 of 14,217 1,961 of 2,696 8,694 of 8,765 0

So it clears exactly the 867 that cd94d35 broke (#1973, #1987). Nothing moves elsewhere: the remaining compute (735, "incompatible with the shader stage", the derivative case of #1065) and mesh (71, output size over 32,768) refusals are the same programs on both builds. This also confirms the result with a 1.9 validator; the numbers in #1987 were from 1.8.

cargo test -p victory-shader --lib --locked: 240 passed, 8 failed. The 8 are the same hardware-only ones that fail on plain main on the Intel Iris Xe the tests use here (BVH 1-ULP, dot products, 64-bit image atomics, wave size, heap cap).

Not tested: the title on the GPU with these programs (this laptop can't reach the world).

AI use: Claude Code (Claude Opus 5.5) built both trees, ran the corpus and wrote this; the results are from the runs described. No game data: counts only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151782336 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7151782336). Originally posted by [AgneyaK](https://github.com/AgneyaK) on 2026-11-25T03:17:55Z. --- An independent full-corpus run of this PR: offline `victory translate --validate` over the title 1.0.2.1's shader pack, release builds, Windows 11 26300. The validator is the SDK `10.0.26100.0\x64\dxil.dll`, which on this machine is **DXC 1.9.2602** (serviced; `IDxcVersionInfo` reports 1.9). This PR (`0f11320`) is a fast-forward of `main` `940d32f`. | | vertex + pixel validated | compute validated | mesh validated | `Flags must match usage` | |---|---|---|---|---| | `main` `940d32f` | 13,350 of 14,217 emitted | 1,961 of 2,696 | 8,694 of 8,765 | **867** | | this PR | **14,217 of 14,217** | 1,961 of 2,696 | 8,694 of 8,765 | **0** | So it clears exactly the 867 that `cd94d35` broke (#1973, #1987). Nothing moves elsewhere: the remaining compute (735, "incompatible with the shader stage", the derivative case of #1065) and mesh (71, output size over 32,768) refusals are the same programs on both builds. This also confirms the result with a 1.9 validator; the numbers in #1987 were from 1.8. `cargo test -p victory-shader --lib --locked`: 240 passed, 8 failed. The 8 are the same hardware-only ones that fail on plain `main` on the Intel Iris Xe the tests use here (BVH 1-ULP, dot products, 64-bit image atomics, wave size, heap cap). Not tested: the title on the GPU with these programs (this laptop can't reach the world). AI use: Claude Code (Claude Opus 5.5) built both trees, ran the corpus and wrote this; the results are from the runs described. No game data: counts only.
Calvix2k commented 2026-11-25 04:06:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T03:32:35Z.


Independent corpus run on AMD / Windows 10, same archive as the other reports (shaders.rpf, 1.0.2.1, 411,695,600 bytes), victory translate … --validate --list --jobs 10, release builds:

build translated validated Flags must match usage
main 940d32f 26,084 23,918 868 (867 programs + the summary line)
this PR 0f11320 26,084 24,785 0

+867 validated, 0 lost — the same delta zed6000 measured on an RX 7900 XTX and @sinan-cmyk on a retail NVIDIA machine, now reproduced on an RX 7800 XT with the SDK 10.0.26100.0 validator (dxil.dll 1.7, i.e. the one default_path picks on this machine). The 1.7 PSV false failures (#1945) are in both runs at the same rate, so they do not affect the delta.

The mesh case Dathinel found is also covered: the corpus has 71 mesh programs failing vertex plus primitive output size is greater than 32768 in both runs — unrelated — and no mesh program appears among the 867.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152011519 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7152011519). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T03:32:35Z. --- **Independent corpus run on AMD / Windows 10**, same archive as the other reports (`shaders.rpf`, 1.0.2.1, 411,695,600 bytes), `victory translate … --validate --list --jobs 10`, release builds: | build | translated | **validated** | `Flags must match usage` | |---|---|---|---| | `main` `940d32f` | 26,084 | **23,918** | 868 (867 programs + the summary line) | | this PR `0f11320` | 26,084 | **24,785** | **0** | +867 validated, 0 lost — the same delta zed6000 measured on an RX 7900 XTX and @sinan-cmyk on a retail NVIDIA machine, now reproduced on an RX 7800 XT with the SDK 10.0.26100.0 validator (`dxil.dll` 1.7, i.e. the one `default_path` picks on this machine). The 1.7 PSV false failures (#1945) are in both runs at the same rate, so they do not affect the delta. The mesh case Dathinel found is also covered: the corpus has 71 mesh programs failing `vertex plus primitive output size is greater than 32768` in **both** runs — unrelated — and no mesh program appears among the 867.
Marvisak commented 2026-11-25 09:06:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:26:37Z.


Automated triage for the maintainers.

Merge candidate.

This fixes #1973 and #1987, a regression from cd94d35. Vertex programs that now declare the view-write bitmap UAV were rejected with "Flags must match usage". The fix is in Shader::finish (emit/shader.rs). It sets shader flag bit 16 (UAVS_AT_EVERY_STAGE) and SFI0 feature 0x4 for non-pixel, non-compute stages that declare a UAV.

I checked that the PR's has_uavs condition is the same one that finish uses on main to build the UAV list in dx.resources (root_uavs / memory_dirty / view_writes), so the flag follows exactly what is declared. Including mesh stages matches DXC's pre-1.8 rule, which the PR cites with source references. Several independent corpus runs in the thread report +867 validated programs and 0 lost, with validators 1.7, 1.8 and 1.9, with no program left with the error. CI (check) passes. The competing #1977 was closed in favour of this PR.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157031025 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7157031025). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T08:26:37Z. --- <!-- victory-triage v1 head=0f11320b1f30ced8fe6ca54710e3e2557c42d441 verdict=merge-candidate at=2026-11-25T08:26:27Z --> Automated triage for the maintainers. **Merge candidate.** This fixes #1973 and #1987, a regression from `cd94d35`. Vertex programs that now declare the view-write bitmap UAV were rejected with "Flags must match usage". The fix is in `Shader::finish` (`emit/shader.rs`). It sets shader flag bit 16 (`UAVS_AT_EVERY_STAGE`) and SFI0 feature `0x4` for non-pixel, non-compute stages that declare a UAV. I checked that the PR's `has_uavs` condition is the same one that `finish` uses on `main` to build the UAV list in `dx.resources` (`root_uavs` / `memory_dirty` / `view_writes`), so the flag follows exactly what is declared. Including mesh stages matches DXC's pre-1.8 rule, which the PR cites with source references. Several independent corpus runs in the thread report +867 validated programs and 0 lost, with validators 1.7, 1.8 and 1.9, with no program left with the error. CI (`check`) passes. The competing #1977 was closed in favour of this PR. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 16:06:42 +00:00
BastienRodz commented 2026-11-25 16:09:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T15:34:29Z.


Superseded by a1a2077 on main ("vertex, geometry and mesh programs with UAVs say so in their flags"), which sets ShaderFlags bit 16 and SFI0 0x4 for the same case. Closing. Thanks to everyone who ran the corpus on this one.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167052620 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1989#issuecomment-7167052620). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-25T15:34:29Z. --- Superseded by a1a2077 on main ("vertex, geometry and mesh programs with UAVs say so in their flags"), which sets ShaderFlags bit 16 and SFI0 0x4 for the same case. Closing. Thanks to everyone who ran the corpus on this one.

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!1987
No description provided.