fix(agc): read an unwritten pixel program address as unset #2022
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2022"
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 NahuelGenchi on 2026-10-09T05:14:20Z.
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 #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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T05:22:25Z.
Review: APPROVED
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.
Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:23:57Z.
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
5c291a55, merged ontomaind70b8998in one build with 33 other AGC/shader PRs that had no Windows run.agc_driver_graphics. None of them reported skipping a case.PATHsetup.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-10T01:51:46Z.
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 (
5c291a55) merged onto main54f28f2d3with other open PRs the title needs to get this far (#1836, #1893, #1709, #1837, #1940), plus a local change that letssceKernelSignalSemaaccept a count of 0 (the title calls it that way).Without this PR: the first depth-only draw aborts with
AGC graphics: depth/stencil-only draws without a pixel shader are not implemented.With this PR: that draw passes. The next stop is the
DB_RENDER_CONTROLdepth clear covered by #2219.Limits: one title, one run each way. Nothing is presented yet at that point, so I can't check that these draws render correctly.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:08:01Z.
Checked the diff, built and ran the libSceAgcDriver ctest scope (273/273,
agc_driver_graphicsandagc_driver_prepared_graphicspass). With the source changes revertedagc_driver_graphicsfails, so the new checks pin the fix. Consistent with the decoder's existing reading of an unwritten address as 0; colour-writing draws are still rejected. Also confirmed on Windows by @popcoder565 and @tv7; merging.