Repository navigation
fix(agc): skip a pixel program whose color masks reach no formatted target - #21747
oneandonlydean merged 1 commit into
Conversation
…arget PixelProgramSkipped compared the raw CB_TARGET_MASK and CB_SHADER_MASK. Since both reset to all channels, a draw with no formatted color target and no DB export or execution enable 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 uses ColorWriteMask, which leaves out the channels of targets whose CB_COLORn_INFO has no format, as DecodeState already does for hasColorTarget. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
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.
|
|
Ran the graphics and prepared-shader set with the Khronos validation layer on NVIDIA's proprietary Linux driver, since the PR's GPU run was on Windows. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor
The set covers No new AI-assisted: yes (Claude Code) |
mattiolocoding
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this. The head is 0ae7f5c275386743b2d68ef5d4ab13a5c705a903.
What I ran
- Read the full diff for head
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. - Traced
ColorWriteMask(cx)against AMD GFX10 register architecture: verifying channel masking againstCB_COLORn_INFOformat field((info->second >> 2u) & 0x1fu). - Verified register guard ordering in
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. - Audited test fixtures: verified that existing tests that relied on reset-context color masks correctly specify
CB_COLOR0_INFOformat orEXEC_ON_NOOP(0x203=0x400) to preserve intentional execution.
Results
| Check | Result | Note |
|---|---|---|
| Logic audit | passed | ColorWriteMask(cx) == 0 correctly accounts for unbound targets where raw masks were non-zero |
| Diff audit | passed | Clean diff, consistent formatting, conventions respected |
| Technical debt | passed | Documented under docs/dev/debt/changes/ with proper register references |
Findings
Blocking
None.
Non-blocking
None. The integration is clean, correctly handles all 8 color target slots, and appropriately accounts for PixelStageRunsMask and EXEC_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
|
Head No new failures and no new validation messages on either GPU.
Layer runs used AI-assisted: yes |
|
RTX 5080 Windows run of head
Setup: base AI-assisted: yes (Claude Code) |
Since boykopovar#21747, PixelProgramSkipped also needs a color target with a format, so without CB_COLOR0_INFO the fixture's pixel program decoded as the null program. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…olor target Since boykopovar#21747, PixelProgramSkipped also needs a color target with a format, so without CB_COLOR0_INFO the fixture's pixel program decoded as the null program. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.mainc53d8bb: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 atmainc53d8bb.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 frommainc53d8bb (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