fix(agc): skip a pixel program whose color masks reach no formatted target #21747
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21747"
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 ashwin280802 on 2026-11-16T18:24:06Z.
What
PixelProgramSkippedcompared the raw CB_TARGET_MASK and CB_SHADER_MASK. Both reset to all channels, so a draw with no formatted color target and no DB export or execution enable still ran its bound pixel program, and a rect-list draw of one with a pass-through input threw "custom per-vertex interpolation is unsupported". The check now usesColorWriteMask, which leaves out the channels of targets whose CB_COLORn_INFO has no format, asDecodeStatealready does forhasColorTarget.The change that starts the color masks at their reset values (
fix(agc): start the color masks and viewport control at their reset values) exposed this: before it the masks started at 0 and such a draw used the null pixel program. Nine existing test setups enabled the masks on the reset context, which has no formatted target, only to make a pixel program run; seven now set a CB_COLOR0_INFO format and the two draws that go through the device set EXEC_ON_NOOP.Sources: PAL DbShaderControl, GFX10 registers, radeonsi, which expects FORMAT INVALID to disable an unbound color buffer's writes; it does not say the pixel program is skipped. Not measured on the console: a mask on a FORMAT 0 target, and DB_ALPHA_TO_MASK (which always keeps the program); both are in the library's debt file.
Overlap:
python tools/pr_overlap.py --names PixelProgramSkipped,ColorWriteMaskreportsopen: none. The branch check found 68 open PRs sharing files with this branch and could not compare 37 of them; none was checked by hand, so I do not claim there is no overlap.Tested
Windows 11, RTX 5070 (driver 621.24). The full suites, validation and title runs below were on bec1751a93, the same patch before its rebase onto current
main; the 36 focused tests were run again after the rebase (e136e1a375) and pass.ctest --test-dir build-full -R <the 36 AGC graphics, prepared graphics, prepared shaders, builtin program memory and unregistered graphics tests>:100% tests passed out of 36.mainc53d8bb2d7:diagnostics: change 0, baseline 0, new 0.agc_driver_upload_cache_read_only_flush_tests, does not build (UploadCacheReadOnlyFlush.cpp:177setenv; the file is identical onmainand untouched here), so it did not run.agc_draw_input_mirrors,agc_draw_input_reuse,agc_driver_coherent_atomic_loads_enabled,agc_driver_global_atomic_csub,agc_driver_recorder,agc_driver_stencil_copy_draw,title_run,title_run_identity,title_run_paths). The author's container also fails these 9 atmainc53d8bb2d7.mainthe run aborts withdriver failure: Rect-list SPIR-V: custom per-vertex interpolation is unsupportedafter 39 s; with this change a 180 s run ends by the time limit with 0 FATAL, driver failure or presentation failed lines and 12 present windows. Both runs used libraries built frommainc53d8bb2d7(the second with thisState.cppchange) and an executable relinked at 8c33c148c3f.python3 tools/check_conventions.py --base origin/main:All conventions checks passed.Not covered by a test: the rect-list draw with a pass-through pixel input that showed the problem; the tests cover
PixelProgramSkippedandDrawRejection, and the draw path is covered only by the title run.Not verified: the 9 Linux failures above were not investigated beyond matching
main; behaviour on a console; other GPU vendors.Checklist
main; no other open PR implements the same functionsNotImplemented_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
Imported from boykopovar/AnyPS5. Originally posted by mattiolocoding on 2026-11-17T21:15:43Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this. The head is
0ae7f5c275386743b2d68ef5d4ab13a5c705a903.What I ran
0ae7f5c275386743b2d68ef5d4ab13a5c705a903:State.cpp, test updates inGraphics.cpp,BuiltinProgramMemory.cpp,PreparedGraphics.cpp,PreparedShaders.cpp,PreparedUnregisteredGraphics.cpp, anddocs/dev/debt/changes/fix-agc-pixel-skip-unbound-targets.md.ColorWriteMask(cx)against AMD GFX10 register architecture: verifying channel masking againstCB_COLORn_INFOformat field((info->second >> 2u) & 0x1fu).PixelProgramSkipped:find(cx, 0x8e)andfind(cx, 0x8f)check for presence beforeColorWriteMask(cx)invokesread(cx, 0x8e) & read(cx, 0x8f), preventingstd::runtime_errorexceptions on unpopulated context states.CB_COLOR0_INFOformat orEXEC_ON_NOOP(0x203=0x400) to preserve intentional execution.Results
ColorWriteMask(cx) == 0correctly accounts for unbound targets where raw masks were non-zerodocs/dev/debt/changes/with proper register referencesFindings
Blocking
None.
Non-blocking
None. The integration is clean, correctly handles all 8 color target slots, and appropriately accounts for
PixelStageRunsMaskandEXEC_ON_NOOP.Sources
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpplines 2350–2359 (ColorWriteMask) and 2855–2865 (PixelProgramSkipped).core/libs/prx/libSceAgcDriver/tests/Graphics.cpplines 328–350.docs/dev/debt/changes/fix-agc-pixel-skip-unbound-targets.md.AI-assisted: yes