fix(agc): support 4_4_4_4 component orders during PPSA38500 loading #27966
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27966"
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 lgqdaxia on 2026-11-27T22:47:27Z.
What
PPSA38500 stopped presenting during story loading on Windows. Its draw requested a packed 4_4_4_4 UNORM color target with
COMP_SWAP=1, which the color decoder rejected.Use the four-channel mapping already used for RGBA16 to select the source of each nibble in the R16_UINT attachment. Full writes and masked writes now honor STD, ALT, STD_REV and ALT_REV. The packing and rounding logic comes from the existing packed export path. AMD PAL four-component swap definitions
For packed 4_4_4_4, check the blend equation only for channels selected by the guest write mask. Source replacement bypasses blending before component-order translation, including STD_REV and ALT_REV. Equations that blend any written channel retain the existing unsupported checks.
Tested
agc_driver_graphicspassed on Ubuntu 26.04.1 LTS, GCC 15.2.0, ate2e97886ee. The test covers alpha-only replacement with RGB writes masked, replacement in both reversed component orders, and rejection when a written channel needs blending. It also checks masked alpha and opaque-destination replacement. Linux validationThe Vulkan comparisons confirmed the component-order fix on Windows with NVIDIA and Linux with AMD.
Vulkan comparisons by GPU and tested revision
Using Windows 11 Pro and NVIDIA driver 621.14, the two Vulkan tests reproduced the format 19, UNORM, swap 1 rejection on main
b19e5a8a96and both passed on399d893d4b. The color-mapping patch was identical on the initial PR headab696034d9.agc_driver_packed_unorm4444_color_targetread back RGBA nibbles 1, 2, 7 and E as0xe721,0xe127,0x127eand0x721efor swap modes 0–3. Pixels outside the scissor kept their initial values.agc_driver_packed_unorm4444_partial_writechecked red-only writes on a tiled target and preserved the other nibbles. Both Vulkan runs loaded validation layer 1.4.368 and reported zero VUID or synchronization errors. The partial-write test emitted the same ten unused fragment-output warnings on each build.agc_driver_graphicspassed on399d893d4b, including the four red-channel masks and unsupported numeric types.tablefrogpillow independently ran
agc_driver_packed_unorm4444_color_targeton a Radeon RX Vega 56 with Linux and RADV. Initial PR headab696034passed three runs with zero validation errors. RestoringState.cppfrom base073e0313reproduced theCOMP_SWAP=1rejection. Independent AMD resultgmankab ran both packed-color fixtures on Fedora Linux 45 Toolbox with a Radeon RX 6800 (RDNA2) and Mesa RADV 26.2.7. The existing decoder on the same startup stack refused
COMP_SWAP=1in both fixtures. Both fixtures andagc_driver_graphicspassed with PR revisionfc78d6bb, including its alpha-blend case. Khronos validation 1.4.350 loaded on both builds and the logs contained zero VUID entries. Independent RDNA2 resultChecklist
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)ab696034and Radeon RX 6800 atfc78d6bb.Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T22:57:07Z.
Review: COMMENTED
7f0fb265-cfc1-4307-91d2-25f70db34624Reviewing files that changed from the base of the PR and between
073e0313f3andab696034d9.core/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444ColorTarget.cppcore/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T23:47:27Z.
Review: COMMENTED
Actionable comments posted: 1
0403932c-65a8-45b6-bec8-59eb682b6304Reviewing files that changed from the base of the PR and between
ab696034d9andfc78d6bb8d.core/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-28T10:08:07Z.
Review: APPROVED
Checked head
e2e97886eeon Windows 11 with WinLibs GCC 15.2 (Release), applied tomainc6331cc61btogether with 13 other open PRs.tools/check_conventions.py --headandtools/debt_fold.py --checkpass, and the full build succeeds.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, and the loader inserted the 1.4.363 layer. It matchesmain: the only failures areagc_driver_linear_target_import_creation, as onmain(fixed in #28029), and on NVIDIA #27972's new NaN row inagc_driver_fp16_overflow_omod. Neither log has aVUID-line.agc_driver_packed_unorm4444_color_target,agc_driver_packed_unorm4444_partial_writeandagc_driver_graphics. All runs pass, with the layer inserted and noVUID-line.mainalso has or that come from load (windows_read_trap_unknown, fixed in #28028, three load timeouts, and aguest_webrtc_threadtiming race in that test).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T11:39:26Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing in the reviewed code shows a concrete defect; the changed graphics state logic and packed-target fixtures support the stated component-order and blend behavior.
What I ran
Reviewed head
e2e97886eee135e83ea9a55e8cdb769768eba6ffusing the prepared diff andrepo_read.pyfor targeted source reads. No tests or build commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded from the review folder because it was too large, and its changed lines were not read. The other changed files reviewed werecore/libs/prx/libSceAgcDriver/Graphics/src/State.cpp,core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444ColorTarget.cpp, andcore/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp. Builds, tests, and reported GPU comparisons were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:45:54Z.
Review: COMMENTED
The partial-write execution loop uses a red-only mask for the newly accepted swaps. Could one case use alpha-only or nonadjacent red and alpha writes with distinct old nibble values? That would exercise remapping and preservation when the selected physical nibble changes with the swap.
Source review at
e2e97886ee. The head trial-merges onto700fae9438. Paired Vulkan execution is queued.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:05:00Z.
Review: COMMENTED
The current fixture extends the red-only cases with combined red/alpha writes across the alternate RGBA4 orders, while keeping distinct old nibbles. That exercises the two remapped channels together and checks preservation of the channels outside the mask. This addresses my earlier coverage request. The paired packed-target and partial-write cases are queued on lavapipe.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T22:10:43Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes correctly map all four component swap orders and preserve packed nibbles on masked writes; I found no verified blocking defect.
What I ran
Reviewed head
449c769a8fffd4637c8f73d6911fd3438dc9bc64against the prepared diff; no merged preview was run. I usedrepo_read.pyat the pinned head for targeted source inspection. No build or test was run.Results
Negative control
Not run; no tests were executed.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No build, automated test, Vulkan execution, or console behavior was independently verified. The reviewed files were
State.cpp,Graphics.cpp,PackedUnorm4444ColorTarget.cpp, andPackedUnorm4444PartialWrite.cpp;files.jsonlists no excluded changed files.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T15:33:44Z.
Review: APPROVED
Re-checked
449c769a8f, the commit added since my approval ate2e97886ee. It is test-only (PackedUnorm4444PartialWrite.cpp) and was applied to main484b0368d3. Windows 11, GCC 15.2,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer(layer 1.4.363), run once with the RTX 5080 (621.24) and once with the AMD iGPU (26.11.2) loader selected. NoVUID-errors in any log, and nowas not found but was requested.agc_driver_graphicsandagc_driver_packed_unorm4444_{color_target,partial_write,multisample_partial_write}: 4 of 4 pass with each loader, including the new red and alpha write checks across the RGBA4 component swaps.AI-assisted: yes (Claude Code)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.