Repository navigation
fix(agc): fragment SampleId, Layer, FragDepth and SampleMask interfaces - #375
Conversation
567a3fb to
dd41c94
Compare
e88b679 to
feb284e
Compare
|
The validator side looks right to me, and the new cases are good. One dependency is missing: the body says the device already enables Could you add |
feb284e to
a40eb82
Compare
|
Thanks, you're right: the description was wrong about
|
|
Thanks, both done. The validator now accepts Geometry and SampleRateShading in a fragment shader only when the device enabled |
a40eb82 to
fcc1118
Compare
|
This conflicts with main now in |
fcc1118 to
cc1ed88
Compare
|
Rebased onto current |
adriadam10
left a comment
There was a problem hiding this comment.
Checked the validator part (SampleId/Layer inputs, FragDepth with DepthReplacing, SampleMask [1] arrays, and Geometry/SampleRateShading gated on the device enables) against what the recompiler emits. Build + full ctest pass on cc1ed88 (360/360). This PR's own commits look good to me.
What blocks merging is the base: this branch carries #295's two commits, and #295 has open review requests (DrawRejection's read(cx, 0x1c4) throws when the register is missing, and the Z-export formats have no test). The same code is here at Graphics/src/State.cpp:793. Once #295 is fixed and merged, rebase this onto main so only the three validator commits remain, and I'll merge it.
|
I've been running Ghost of Yotei (PPSA26344 v1.008) with this PR in our integration tree, and it's what gets the game's depth-writing pixel shaders through now. The game has two depth-only draws that export Z: a In a 1,500 s run on an older main (before #295) and without this PR, 1,825 of those draws were skipped. With this PR at cc1ed88 on main 0d3c1ee, a 2,700 s run skips none of them, and nothing else rejects them instead: no Since #295 already brought the DB_SHADER_CONTROL part to main, I checked what main does on its own. Main's recompiler emits The PR conflicts with main at the moment. In our tree the merge was mechanical: main added DetailsBuilds:
The skipped draws, from
With the PR: 0 and 0 in the cold 2,700 s run (1,115 presents) and in the warm 2,700 s run. Neither run's log has
|
The recompiler emits SampleId and Layer fragment inputs (pixel ancillary data) and a FragDepth output with the DepthReplacing execution mode (depth export), but the validator refused them, so those draws were skipped. They are now accepted, as are the Geometry and SampleRateShading capabilities those inputs need in fragment shaders. The device enables both features when it has them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pixel shaders that export a coverage mask write gl_SampleMask, an int[1] (or uint[1]) output. The validator rejected array interface types; it now spells them elem[N] and accepts SampleMask as int[1] or uint[1]. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e device enabled them The validator takes the geometryShader and sampleRateShading enables from the context (set where boykopovar#295 enables them), so a device without them refuses the draw instead of creating a module that needs features it never enabled. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cc1ed88 to
29aa275
Compare
|
Rebased onto current @Celegans12 thanks for the Yotei runs. That matches what I see: |
adriadam10
left a comment
There was a problem hiding this comment.
Rechecked on 29aa275 merged with current main: build + full ctest pass (400/400), and the base issue from my previous review is gone now that #295 is merged, so I'm withdrawing that request.
- The accepted types match what the recompiler emits (
SampleMaskArrayTypeisint[1], Layer/SampleId are loaded asint). - The new array case in
Signature()doesn't let arrayedLocationvariables through:AddLocationsstill unrolls them first.
Runtime coverage is good too: GTA V, Dreaming Sarah and Demon's Souls from the author, plus @Celegans12's 2,700 s Ghost of Yotei run with no skipped Z-export draws. Merging. @oneandonlydean, if your PPSA21564 run turns something up, a follow-up PR can handle it.
What
The recompiler emits the following, but the SPIR-V validator refused them, so the draws were skipped:
DepthReplacingexecution mode (Z export);int[1]oruint[1]array. Array interface types are now spelledelem[N]by the validator.The validator now accepts them, together with the Geometry and SampleRateShading capabilities those inputs need in fragment shaders. They are accepted only when the device enabled
geometryShaderandsampleRateShading(#295 adds those enables), so a device without them refuses the draw. Vertex stages still refuse those capabilities.GTA V's lighting, decal and particle shaders use these interfaces. The log showed
unsupported device capability 2/35,unsupported fragment built-in,unsupported SPIR-V interface typeandunsupported fragment execution mode.Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
main.ctest: all tests pass. New validation cases cover a fragment shader with SampleId, Layer, FragDepth and SampleMask, a SampleMask of the wrong length, and a vertex shader refusing SampleRateShading.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositorymainwith fix(recompiler): start pixel waves without their helper invocations in EXEC #305, whose HelperInvocation input is kept in the same fragment built-in check🤖 Generated with Claude Code