Repository navigation
fix(agc): build static rasterizer discard pipelines without fragment state - #23982
Conversation
…state A draw that discards rasterization (SPI_SHADER_POS_FORMAT entry 0 of zero, or the tessellation capture pass of a tessellation plus geometry draw) baked rasterizerDiscardEnable into a pipeline that still carried the draw's fragment shader, colour and depth attachments and fragment dynamic states, and into pipeline libraries whose pre-rasterization part cannot take null set layouts under a static discard. Vulkan forbids a fragment stage when the pipeline has no fragment shader state (VUID-VkGraphicsPipelineCreateInfo-pStages-06894), the begun rendering had no attachments while the pipeline declared them (VUID-vkCmdDraw-colorAttachmentCount-06179), and the draw set stencil reference, depth bounds and colour write masks the pipeline did not make dynamic (VUID-vkCmdDraw-None-08608). A pipeline that bakes rasterizer discard is now created whole, without a fragment stage, rendering attachments or those dynamic states, and its draws no longer set them. It is no longer built from pipeline libraries.
|
AMD datapoint, since the PR has no AMD run. I ran the new Environment: Mesa 26.2.6 RADV, Khronos validation layer 1.4.363,
The PR head also passes on Vega without the validation layer, once in each mode. On RADV the control's |
|
Thank you @tablefrogpillow, that is the AMD coverage this PR was missing, on three generations. The I've added your runs to the tested GPUs in the description. AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
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
- Reviewed head
4867f6e79a0244df6c889606ef5ba423a66af491using the pinned repository readerrepo_read.py. - No build or tests run in this review. The CI and hardware results in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Pipeline and test changes inspected |
| Build and tests | not run | No local execution performed |
| Reported CI | not run | Results supplied in the description |
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.- The
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. - No local compilation, CTest execution, Vulkan validation run, or console run was performed. CI and hardware results listed in
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.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
@chitters2004 #24305 (gates the interlock pipeline workarounds on RADV from Mesa 26.3.1) touches two of the lines you change in
Both conflicts are textual and resolve by keeping both conditions. I'd suggest yours goes first since it was opened first, and I'll rebase onto it. Does that work for you? I'll record the order in both PR bodies. |
|
@janzezno that works for me, thanks for checking. Keeping both conditions in both places is the right resolution. @MarcZX10 on the test target: AI-assisted: yes |
# Conflicts: # core/libs/prx/libSceAgcDriver/tests/Graphics.cpp # core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp
MarcZX10
left a comment
There was a problem hiding this comment.
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
- Reviewed head
b49dd669de1609e8dbebb56362f4c666d9b17e7busingrepo_read.pyto inspect the prepared diff, manifest, changed-file excerpts, and targeted repository context. - No build, tests, or prechecks were run in this review.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted code review | passed | No concrete defect found in inspected code |
| Build and tests | not run | CI and hardware results are author-reported |
| Full changed-file review | not run | Some complete file texts were not read |
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 large tests/Graphics.cpp was 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.json was 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 of Graphics/src/Pipeline.cpp, tests/Graphics.cpp, and tests/execution/DepthFastClearHarness.hpp; and the full added tests/cmake/agc_driver_rasterizer_discard_tests.cmake and tests/execution/RasterizerDiscard.cpp as shown in the diff.
Files excluded: tests/Graphics.cpp full text (too large for the review folder); excluded-by-rule files not verified.
To get this to a good state
Nothing is required.
# Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
MarcZX10
left a comment
There was a problem hiding this comment.
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
- Read the prepared description, commits, manifest and diff for head
25485af4adc9441c294e274787fc4eb615464214. - Read changed pipeline implementation/header, execution harness, execution test and CMake test registration through
repo_read.py. - No commands or tests were run. The PR description reports CI and local test results; these were not independently run here.
Results
| Check | Result | Note |
|---|---|---|
| Static discard pipeline logic | passed | Whole pipeline, fragment stage removed, attachment metadata cleared |
| Execution test and registration | passed | Discard alternation and depth/stencil targets inspected |
| Full changed-file review | not run | Graphics.cpp was excluded as too large |
| Runtime checks | not run | Reported CI and hardware runs not repeated |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The changed core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was 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.json was not available through the reader; the manifest identifies Graphics.cpp as excluded due to size. The provided diff.patch omits lockfiles, minified files, generated directories, and SVG files by preparation rule.
To get this to a good state
Review the excluded Graphics.cpp test changes and rerun the relevant checks on this head before approval.
GPU test run: ✅ no new failures or validation errors on Windows / NVIDIABasis: built and ran · this PR's head Checked
Findings: none from this run; this is a GPU run, not a code review. AI-assisted test run (Claude Code) · head |
|
Verdict: on an AMD R9700 under Windows, the six focused tests pass 3 of 3 on the merge, with 0 Code. I read the diff at
Existing runs.
None used AMD's Windows driver. Negative control. On the merge I restored
I then restored the PR's files. GPU. Command, for main and for each head run:
Validation. Every head and control log shows the loader inserting Speed evidence. None in the PR, and none is claimed. I did not measure speed.
AI-assisted: yes |
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
MarcZX10
left a comment
There was a problem hiding this comment.
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.py was used to inspect the prepared diff and targeted source ranges.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Pipeline changes and included tests inspected |
| Tests | not run | CI and hardware results are author-reported |
| Negative control | not run | Only author-reported results available |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The complete body of tests/Graphics.cpp was 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 for tests/Graphics.cpp. review/files.json was unavailable via the reader; the changed-file inclusion list was checked with its directory listing.
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.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(c3a8236); no other open PR implements the same functions (this replaces our fix(agc): key the pre-rasterization library by rasterizer discard #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