Shaders: centroid position with conservative depth #565
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/565"
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 SAitken91 on 2026-11-24T05:00:58Z.
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
Imported from Marvisak/VIctory. Originally posted by KoLolX3 on 2026-11-24T05:32:10Z.
Check on Linux, not Windows: pass. Head
c249f02ddmerged ontomaind2a4bae1f(clean merge).core,formats,game,loader,pe,pipeline,shader): PR92 passed, 7 failed,main92 passed, 7 failed.cargo xwin check --workspace --target x86_64-pc-windows-msvc, coversvictory-gpu,victory-hleand the app): PR ok,mainok.main168.mainhere as well (not this PR): 7 tests invictory-loaderandvictory-pethat parse their own test binary as a PE image, which is an ELF file on Linux.victory-gpu/victory-hletests 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.
Imported from Marvisak/VIctory. Originally posted by iurysf on 2026-11-24T06:17:09Z.
Tested offline against main
d2a4baewithvictory translate --list --validateover the title'sshaders.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.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:56:47Z.
Review: APPROVED
Tested
c249f02on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (264 passed, 0 failed).victory translate <title exe> --validate --pipelinesgives 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.DepthGreaterEqual/DepthLessEqual, and 3 isPosition. Interpolation mode 5 isLinearNoperspectiveCentroid, the form the validator asks for when oDepthGE/LE is written.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).
Imported from Marvisak/VIctory. Originally posted by slint6614-dev on 2026-11-24T07:47:14Z.
Measured on the full retail shader pack (26,503 containers) with
victory translate --validate, against maind2a4bae(emitted / validated). Windows 11, dxil.dll from SDK 10.0.26100.cargo test -p victory-shaderpasses on all four.