fix(agc): build static rasterizer discard pipelines without fragment state #23982
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23982"
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 boykopovar/AnyPS5. Originally posted by chitters2004 on 2026-11-20T00:04:00Z.
What
A draw that discards rasterization bakes
rasterizerDiscardEnableinto its pipeline.Pipeline(Graphics/src/Pipeline.cpp) still built that pipeline with the draw's fragment shader stage, its colour and depth rendering attachments and the fragment dynamic states, whilePipeline::Beginbegins rendering with no attachments for discard draws. Vulkan forbids this:VUID-VkGraphicsPipelineCreateInfo-pStages-06894: a fragment stage in a pipeline without fragment shader state;VUID-vkCmdDraw-colorAttachmentCount-06179: the pipeline declares attachments the begun rendering does not have;VUID-vkCmdDraw-None-08608: the draw sets stencil reference, depth bounds and colour write masks that the pipeline did not declare dynamic;VUID-VkGraphicsPipelineCreateInfo-flags-06683: a pre-rasterization library with a null set layout under a static discard.Two draw paths reach it:
SPI_SHADER_POS_FORMATentry 0 of zero (State.cpp), and the capture pass of tessellation followed by a geometry stage (drawTessellationGeometryinDraw.cpp, the path Crimson Desert PPSA25286 uses, #6612). The capture pass copies the real draw's state, so it carries that draw's colour targets.The libraries also had a visible effect: the pre-rasterization library key does not include the discard flag, so a normal draw with the same shaders as an earlier discard draw reused the discard library and covered no pixels (the new test shows
covered 0 of 2048 pixelson main).A pipeline that bakes rasterizer discard is now created whole, never from libraries, without a fragment stage, without rendering attachments and without the stencil reference, depth bounds and colour write mask dynamic states. Its draws no longer set them.
Tested
staticDiscardPipelineTestsintests/Graphics.cpp(agc_driver_graphics): a discard pipeline is not prebuilt from libraries, is created without a fragment stage, with zero rendering attachments and without those dynamic states, and its draw sets none of them.tests/execution/RasterizerDiscard.cpp(agc_driver_rasterizer_discard_render_passandagc_driver_rasterizer_discard_libraries): draws with and without discard alternately into depth and depth+stencil targets and requires 0 covered pixels with discard and all covered pixels without.c3a823624f),agc_driver_graphics,agc_driver_rasterizer_discard*,agc_driver_stencil_replay*: all passed, 0 VUID lines: https://github.com/chitters2004/AnyPS5/actions/runs/44638300584Pipeline.cpp/Pipeline.hppchange (branchdraft/static-discard-control):agc_driver_graphics,agc_driver_rasterizer_discardandagc_driver_rasterizer_discard_librariesfail on Linux and Windows, with 36 VUID lines (06683, 06894, 08608, 06179): https://github.com/chitters2004/AnyPS5/actions/runs/44638358466agc_driver_graphics, passing, without the layer); on the control the execution tests report the four VUIDs above plusVUID-vkCmdDraw-dynamicRenderingUnusedAttachments-08914.python -I tools/check_conventions.pypasses.Checklist
main(c3a823624f); no other open PR implements the same functions (this replaces our #22058, which only added the discard flag to the pre-rasterization library key and left the invalid pipelines; it will be closed in favour of this PR)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T06:35:27Z.
Review: COMMENTED
Reviewed — comments
The pipeline changes address the reported static-discard mismatch; one integration detail needs clarification because the new execution-test target is not registered in the changed CMake fragment.
What I ran
4867f6e79a0244df6c889606ef5ba423a66af491using the pinned repository readerrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_rasterizer_discard_tests.cmake:2and:4register tests that invokeagc_driver_rasterizer_discard_tests, but the changed files do not define or add that executable. Thetests/execution/RasterizerDiscard.cppsource therefore depends on target registration elsewhere; clarify where that target is created or add it to the test target configuration so these CTest entries are runnable.Not verified
Graphics.cppwas read only at the changed regions; its unchanged contents were not reviewed. The source file is included in the review manifest but was too large for the review folder.files.jsondocument was not available as a reader path; changed-file inclusion status was obtained from the reader’s file listing. All other changed files listed in the manifest were read.description.mdwere not independently verified.To get this to a good state
Nothing is required. Optional: clarify or add the executable target backing the two new CTest entries.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:42:10Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected pipeline changes and targeted tests are consistent with the stated fix; I did not run the reported CI or local checks, and the full text of some changed files was not read.
What I ran
b49dd669de1609e8dbebb56362f4c666d9b17e7busingrepo_read.pyto inspect the prepared diff, manifest, changed-file excerpts, and targeted repository context.Results
Findings
Blocking
None found in the inspected code.
Non-blocking
None.
Not verified
The full text of
Graphics/src/Pipeline.cpp,Graphics/include/Pipeline.hpp,tests/execution/DepthFastClearHarness.hpp, and the largetests/Graphics.cppwas not read; targeted changed sections were inspected. No tests, build, or prechecks were run by me. CI and hardware results in the PR description were not independently verified.files.jsonwas not available in the prepared bundle listing, so excluded-by-rule files could not be confirmed.Files read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch; targeted lines ofGraphics/src/Pipeline.cpp,tests/Graphics.cpp, andtests/execution/DepthFastClearHarness.hpp; and the full addedtests/cmake/agc_driver_rasterizer_discard_tests.cmakeandtests/execution/RasterizerDiscard.cppas shown in the diff.Files excluded:
tests/Graphics.cppfull text (too large for the review folder); excluded-by-rule files not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T02:48:53Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected pipeline changes address the stated static rasterizer discard issues; one changed test file was excluded from the review bundle, so approval is not justified.
What I ran
25485af4adc9441c294e274787fc4eb615464214.repo_read.py.Results
Graphics.cppwas excluded as too largeFindings
Blocking
None.
Non-blocking
None.
Not verified
The changed
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas not included in the prepared files because it exceeded the bundle limit. Its new test body was therefore not read. No builds, tests, validation-layer runs, or console behavior were independently verified.files.jsonwas not available through the reader; the manifest identifiesGraphics.cppas excluded due to size. The provideddiff.patchomits lockfiles, minified files, generated directories, and SVG files by preparation rule.To get this to a good state
Review the excluded
Graphics.cpptest changes and rerun the relevant checks on this head before approval.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T20:58:04Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation addresses the invalid static-discard pipeline state and adds regression coverage.
What I ran
Reviewed head
9429505033649a36bb6282c30b1299c4494247c2. I did not run commands or tests;repo_read.pywas used to inspect the prepared diff and targeted source ranges.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The complete body of
tests/Graphics.cppwas not read; only the changed ranges were inspected. No test execution, Vulkan validation, hardware behavior, or CI result was independently verified. The author reports successful CI and hardware runs in the PR description.To get this to a good state
Nothing is required.
Files read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch; all changed files in the manifest were inspected, with only changed ranges read fortests/Graphics.cpp.review/files.jsonwas unavailable via the reader; the changed-file inclusion list was checked with its directory listing.