Repository navigation
fix(agc): read an unwritten pixel program address as unset - #2022
Conversation
PixelProgramSkipped only treated SPI_SHADER_PGM_LO/HI_PS written as 0 as a draw without a pixel program, while the draw decoder already reads an unwritten address as 0 and binds the null pixel program for it. A depth/stencil-only draw whose pixel program address was never written was instead rejected by the precheck with "depth/stencil-only draws without a pixel shader are not implemented". An unwritten address is now unset in PixelProgramSkipped too, so such a draw goes through the null pixel program like one with the address written as 0, and one that writes color is rejected as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the full diff and the draw precheck/null pixel program flow. Treating unwritten LO/HI registers as zero matches the decoder behavior, the precheck no longer intercepts valid depth/stencil-only draws, and the fixture now declares its real pixel program. The added tests cover color rejection and depth-only acceptance. Linux, Windows, changes, conventions, and report checks pass for this head.
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
|
Tested on Windows with Marvel's Wolverine (PPSA03671). Setup: Windows 11 Pro (10.0.26200), RTX 3070, GCC 15.2.0 UCRT (WinLibs), Release. This PR (5c291a5) merged onto main 54f28f2 with other open PRs the title needs to get this far (#1836, #1893, #1709, #1837, #1940), plus a local change that lets Without this PR: the first depth-only draw aborts with With this PR: that draw passes. The next stop is the Limits: one title, one run each way. Nothing is presented yet at that point, so I can't check that these draws render correctly. |
|
Checked the diff, built and ran the libSceAgcDriver ctest scope (273/273, |
…n-pixel-program fix(agc): read an unwritten pixel program address as unset
What
A depth/stencil-only draw whose pixel program address (
SPI_SHADER_PGM_LO/HI_PS) was never written is rejected onmainwith:The draw decoder already reads an unwritten address as 0 and binds the null pixel program for it (
DecodeGraphicsPrograms, since #469). OnlyPixelProgramSkippedrequired both registers to be present and 0, and the precheck inDrawPrecheck.cpprejected the never-written case before the draw got there.PixelProgramSkippednow reads an unwrittenSPI_SHADER_PGM_LO/HI_PSas unset, like a written 0.NullPixelProgramRejectionthen applies to such a draw too, so one that writes color is rejected as "a draw without a pixel program writes color", as with a written 0.makeState()now names a pixel program at 0x100. Its draws relied on an absent address being read as a real pixel program.Tested
Ubuntu 26.04, GCC 15.2, Release build, AMD Radeon R9 380 (RADV, Mesa 26.0.8).
agc_driver_graphicspasses. New checks: with both registers erased, the draw is read as having no pixel program, is rejected if it writes color, and is accepted as depth-only otherwise. Without thePixelProgramSkippedchange the new check fails withan unwritten pixel program address was not read as unset.ctest: 492/494.agc_driver_emulated_color_compare(needsshaderResourceMinLod, which GFX8 lacks) andagc_driver_f32_denormal_flush(v_fma_f32denormal result on GFX8) fail the same way onmainon this card.SPI_SHADER_PGM_LO_PS. Before, they stopped at the precheck above. With this change they reach the null pixel program variant,prepared shader artifact is missing for the requested static ABI ... stage=5 wave=64, which fix(agc): prepare the null pixel program at draw when its variant was not prepared #1902 covers.tools/check_conventions.py --base origin/mainpasses.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 repository (attach them to this PR)🤖 Generated with Claude Code