Shaders: centroid position with conservative depth #565

Manually merged
github merged 1 commit from gh-pr/565/head into gh-pr/565/base 2026-11-26 04:08:31 +00:00
Owner

@⁠SAitken91 on GitHub · 2026-11-24 05:00 UTC · original
SAitken91:shader/conservative-depth-position → main · +7 −0 · 1 files · 1 commits · merged 2026-11-24 08:18 UTC

Pixel programs that write SV_DepthLessEqual or SV_DepthGreaterEqual failed validation (14 in shaders.rpf, for example PS_OctaSLODReZ):

Interpolation mode for PS input position must be linear_noperspective_centroid or linear_noperspective_sample when outputting oDepthGE or oDepthLE

Change

When a pixel program's outputs include a conservative depth (kinds 18 and 19), its SV_Position input is declared linear_noperspective_centroid (5) instead of linear_noperspective (4). This matches what DXC declares for the same case. Without multisampling the position's value is the same.

Results

victory translate --validate shaders.rpf: vertex/pixel validated 12172 → 12186. The error is gone from the list.

Testing

  • cargo test -p victory-shader: 69 passed. Clippy and rustfmt are clean.
  • Not exercised at runtime.

This is independent of #539, #554 and #563.

Written with the help of Claude (AI).

🤖 Generated with Claude Code

**@⁠SAitken91** on GitHub · 2026-11-24 05:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/565) `SAitken91:shader/conservative-depth-position` → `main` · +7 −0 · 1 files · 1 commits · merged 2026-11-24 08:18 UTC Pixel programs that write `SV_DepthLessEqual` or `SV_DepthGreaterEqual` failed validation (14 in shaders.rpf, for example `PS_OctaSLODReZ`): > Interpolation mode for PS input position must be linear_noperspective_centroid or linear_noperspective_sample when outputting oDepthGE or oDepthLE ## Change When a pixel program's outputs include a conservative depth (kinds 18 and 19), its `SV_Position` input is declared `linear_noperspective_centroid` (5) instead of `linear_noperspective` (4). This matches what DXC declares for the same case. Without multisampling the position's value is the same. ## Results `victory translate --validate shaders.rpf`: vertex/pixel validated 12172 → 12186. The error is gone from the list. ## Testing - `cargo test -p victory-shader`: 69 passed. Clippy and rustfmt are clean. - Not exercised at runtime. This is independent of #539, #554 and #563. Written with the help of Claude (AI). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Pixel programs that write SV_DepthLessEqual or SV_DepthGreaterEqual
failed validation: "Interpolation mode for PS input position must be
linear_noperspective_centroid or linear_noperspective_sample when
outputting oDepthGE or oDepthLE". The position is now declared
linear_noperspective_centroid in those programs, as DXC declares it;
without multisampling the value is the same.

translate --validate on shaders.rpf: vertex/pixel 12172 -> 12186
validated; the error is gone from the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:08:30 +00:00
github manually merged commit c249f02dd5 into gh-pr/565/base 2026-11-26 04:08:31 +00:00
Author
Owner

@⁠KoLolX3 on GitHub · 2026-11-24 05:32 UTC · original

Check on Linux, not Windows: pass. Head c249f02dd merged onto main d2a4bae1f (clean merge).

  • Native tests of the seven crates that build on Linux (core, formats, game, loader, pe, pipeline, shader): PR 92 passed, 7 failed, main 92 passed, 7 failed.
  • Windows cross type-check of the whole workspace (cargo xwin check --workspace --target x86_64-pc-windows-msvc, covers victory-gpu, victory-hle and the app): PR ok, main ok.
  • Tests this PR adds: 0 (so the native result only shows the existing tests still pass; the change itself is not covered by a test here).
  • rustfmt: unformatted hunks, PR 168, main 168.
  • Failing on main here as well (not this PR): 7 tests in victory-loader and victory-pe that parse their own test binary as a PE image, which is an ELF file on Linux.
  • Not run: victory-gpu / victory-hle tests and the game itself.

On: AMD Ryzen 7 5700, 62 GB RAM, Artix Linux 7.3.4-artix1-2, rustc 1.98.1 (the repo's pinned toolchain), cargo-xwin 0.24.1. No game data. Automated check only: the code itself was not reviewed.

**@⁠KoLolX3** on GitHub · 2026-11-24 05:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/565#issuecomment-7123038965) Check on Linux, not Windows: **pass**. Head `c249f02dd` merged onto `main` `d2a4bae1f` (clean merge). - Native tests of the seven crates that build on Linux (`core`, `formats`, `game`, `loader`, `pe`, `pipeline`, `shader`): PR `92 passed, 7 failed`, `main` `92 passed, 7 failed`. - Windows cross type-check of the whole workspace (`cargo xwin check --workspace --target x86_64-pc-windows-msvc`, covers `victory-gpu`, `victory-hle` and the app): PR ok, `main` ok. - Tests this PR adds: 0 (so the native result only shows the existing tests still pass; the change itself is not covered by a test here). - rustfmt: unformatted hunks, PR 168, `main` 168. - Failing on `main` here as well (not this PR): 7 tests in `victory-loader` and `victory-pe` that parse their own test binary as a PE image, which is an ELF file on Linux. - Not run: `victory-gpu` / `victory-hle` tests and the game itself. On: AMD Ryzen 7 5700, 62 GB RAM, Artix Linux 7.3.4-artix1-2, rustc 1.98.1 (the repo's pinned toolchain), cargo-xwin 0.24.1. No game data. Automated check only: the code itself was not reviewed.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 06:17 UTC · original

Tested offline against main d2a4bae with victory translate --list --validate over the title's shaders.rpf + executable (26,096 programs), dxil.dll 1.9.2602.17: emission is unchanged (3,733 failures, 12,284 emitted), and validation improves as claimed. The "Interpolation mode for PS input position ... oDepthGE/oDepthLE" rejections disappear (14 -> 0), vertex+pixel validated 12,184 -> 12,198, and total rejected 185 -> 171. No program that validated on main fails now.

AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 06:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/565#issuecomment-7123775759) Tested offline against main `d2a4bae` with `victory translate --list --validate` over the title's `shaders.rpf` + executable (26,096 programs), dxil.dll 1.9.2602.17: emission is unchanged (3,733 failures, 12,284 emitted), and validation improves as claimed. The "Interpolation mode for PS input position ... oDepthGE/oDepthLE" rejections disappear (14 -> 0), vertex+pixel validated 12,184 -> 12,198, and total rejected 185 -> 171. No program that validated on main fails now. AI-assisted.
Author
Owner

@⁠slint6614-dev on GitHub · 2026-11-24 07:47 UTC · original

Measured on the full retail shader pack (26,503 containers) with victory translate --validate, against main d2a4bae (emitted / validated). Windows 11, dxil.dll from SDK 10.0.26100.

VS/PS MS validator failures changed
main 12272 / 12172 8191 / 8129
#554 12272 / 12214 8191 / 8130 clears all 49 "interpolation mode that differs from another element packed into the same row"; "Program Input Signature does not match" 21 → 23, "Program Output Signature does not match" 25 → 29
#565 12272 / 12186 8191 / 8129 clears the 14 "Interpolation mode for PS input position must be linear_noperspective_centroid…"
#381 12272 / 12172 8191 / 8129 none on this pack
#306 12316 / 12316 8191 / 8138 clears both kinds above and the signature mismatches (all VS/PS that emit validate)

cargo test -p victory-shader passes on all four.

**@⁠slint6614-dev** on GitHub · 2026-11-24 07:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/565#issuecomment-7125370101) Measured on the full retail shader pack (26,503 containers) with `victory translate --validate`, against main d2a4bae (emitted / validated). Windows 11, dxil.dll from SDK 10.0.26100. | | VS/PS | MS | validator failures changed | |---|---|---|---| | main | 12272 / 12172 | 8191 / 8129 | | | #554 | 12272 / 12214 | 8191 / 8130 | clears all 49 "interpolation mode that differs from another element packed into the same row"; "Program Input Signature does not match" 21 → 23, "Program Output Signature does not match" 25 → 29 | | #565 | 12272 / 12186 | 8191 / 8129 | clears the 14 "Interpolation mode for PS input position must be linear_noperspective_centroid…" | | #381 | 12272 / 12172 | 8191 / 8129 | none on this pack | | #306 | 12316 / 12316 | 8191 / 8138 | clears both kinds above and the signature mismatches (all VS/PS that emit validate) | `cargo test -p victory-shader` passes on all four.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!565
No description provided.