Shaders: declare UAVsAtEveryStage for vertex/geometry programs with UAVs #1975
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1977"
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?
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T02:14:49Z.
Closes #1973.
Problem
Since
cd94d35the validator rejects 867 vertex programs with "Flags must match usage". The validator recomputes the DXIL shader flags from the module's resources, and a vertex or geometry program here can carry UAVs (root UAVs, or the written-pages/view-mark bitmaps the converter binds for memory writes) without the module declaringUAVsAtEveryStage(shader flag 16). The recomputed flags then differ from the ones indx.shaderFlags.Change
crates/victory-shader/src/emit/shader.rs:flags::UAVS_AT_EVERY_STAGE(1 << 16);memory_dirty,view_marks,view_writes);SFI0feature bit0x4.This is zed6000's tested patch from #1973, unchanged in behaviour; I only split the comment and rebased it onto
mainat940d32f.Verification
zed6000 on an RX 7900 XTX (
940d32f+ patch vs940d32f):940d32fccfb029(beforecd94d35)cargo test -p victory-shader --lib: 247 passed, 0 failed there.On my RX 7800 XT host (Windows 10 19045, driver 32.0.32029.2010) the same command gives 172 passed, 75 failed, and every failure is the same environment limit, not this change:
no SM 6.6 hardware device (the device supports SM 0x65 only)/no SM 6.6 warp device (… SM 0x62 only). Windows 10 reports SM 6.5 for this adapter, so the GPU probe suites cannot create a device at all; they fail identically on unpatchedmain. The CPU-only emission tests (the ones that build and validate the metadata this patch changes) all pass.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 1 file ok.I could not re-run the 867-program count here because it needs a device that accepts the wave64/SM 6.6 modules; that measurement stands on zed6000's run.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:56:48Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. UAVsAtEveryStage declared for vertex/geometry programs with UAVs. Note: overlaps with #1989 (same UAVsAtEveryStage declaration, 2 files vs 1) — whichever lands second must reconcile; both pass independently.
Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-25T02:15:28Z.
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.
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T02:36:35Z.
Offline measurement on a retail dump: +867, 0 lost, the same set as #1989
I merged head
e3cefe5ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs).main940d32f0f11320), for comparisonAll 867 failed with "Flags must match usage" on
main. All of them are vertex programs, and this PR and #1989 restore exactly the same 867 programs. So on this data, either PR fixes thecd94d35regression (#1973, #1987) completely. Review can pick between them on code and tests alone. I also bisected the regression independently tocd94d35(868 programs at that commit, 0 at its parent).AI-assisted (Claude Code). No shader names or data are included, per the asset policy.
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T02:38:46Z.
Closing this in favour of #1989 (@BastienRodz), which is the same flag fix but strictly better, and it is green and mergeable:
Flags must match usage, declared0x40000010, expected0x40010010): myvertex_likeexcludes mesh (self.mesh.is_none()), because I took zed6000's condition as-is. #1989'sgraphics && !self.pixelincludes mesh and passes all six fixture cases. Changing only the predicate here would fix it, but then the two PRs are the same PR.vertex_uav_writes_declare_uavs_at_every_stage, which parses theShaderFlagsword out ofdx.entryPointsand asserts bit 16 and the clear case. Mine relied on the hardware census only.The corpus numbers from #1973 apply to both:
+867 validated, 0 lostover 25,889 programs onmain 940d32f, confirmed independently by @sinan-cmyk in #1977 and by zed6000. Nothing is lost by closing this one — the code is the same two bits, and #1989 covers one more stage.For #1989:
view_marksandview_writesare created together inmark_view_write, so omittingview_marks.is_some()from the condition is fine as it stands.Pull request closed