Repository navigation
Shaders: centroid position with conservative depth - #565
Conversation
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 <noreply@anthropic.com>
|
Check on Linux, not Windows: pass. Head
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. |
|
Tested offline against main AI-assisted. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested c249f02 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (264 passed, 0 failed). victory translate <title exe> --validate --pipelines gives the same counts before and after: 12 of 12 programs emitted, 12 validated, 12 pipelines. None of these 12 programs writes conservative depth, so I could not reproduce the 12172 → 12186 figure.
- The DXIL constants are right: semantic kinds 18/19 are
DepthGreaterEqual/DepthLessEqual, and 3 isPosition. Interpolation mode 5 isLinearNoperspectiveCentroid, the form the validator asks for when oDepthGE/LE is written. - Behaviour: without MSAA a centroid
SV_Positionequals the pixel centre. With MSAA it moves to the centroid of the covered samples on partially covered pixels. DXC makes the same trade-off, and the alternative is no pipeline at all.
No issues found.
AI-assisted (Claude Code).
…rvative depth Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Measured on the full retail shader pack (26,503 containers) with
|
…tion Shaders: centroid position with conservative depth
…pth-position Shaders: centroid position with conservative depth
…mirror GPU: mirror descriptor slots copied directly inside title heap memory
…s memory their flights write A texture to buffer copy's read-back wrote its rows into title memory with a plain copy: where the title had unmapped the destination meanwhile that was an access violation, and the dirty bits of the pages it wrote were taken for the title's own writes. Each row now goes through copy_mapped, as a copy-back does (the guards opened, nothing written where memory is not there, the dirty bits forgotten). And a flight's read-backs (those and the copies of shader-written textures) now count as memory it writes, so a later submission or a wait that reads there waits for them as it does for the flight's shader writes; the texture to buffer read-backs were left out. Source: fxceless/victory-fork pull request Marvisak#565 (AscilCH), ported to our copy path; the span's test from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pixel programs that write
SV_DepthLessEqualorSV_DepthGreaterEqualfailed validation (14 in shaders.rpf, for examplePS_OctaSLODReZ):Change
When a pixel program's outputs include a conservative depth (kinds 18 and 19), its
SV_Positioninput is declaredlinear_noperspective_centroid(5) instead oflinear_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.This is independent of #539, #554 and #563.
Written with the help of Claude (AI).
🤖 Generated with Claude Code