feat(agc): draw into 2_10_10_10 UINT color targets #22609
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22609"
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 milescoviello on 2026-11-17T23:09:47Z.
What
Crimson Desert (PPSA25286) stops with
AGC graphics: unsupported color format 9 number type 4 component swap 0once it gets past the cube store fixed in #22534. The draw renders into a2_10_10_10colour target withNUMBER_TYPEUINT, andDecodeColorFormatRawonly knew the UNORM version of that format.CB_COLOR_INFOFORMAT9,NUMBER_TYPE4,COMP_SWAP0 now decodes toVK_FORMAT_A2B10G10R10_UINT_PACK32. That is the same bit layout as the UNORM case already uses (red in the low 10 bits), and Vulkan requires colour attachment support for it.COMP_SWAP1 (A2R10G10B10_UINT, optional in Vulkan) still throws.32_R) or clamped (32_GR,32_ABGR,FP16_ABGR) in the shader by the packings from #11513 and #15693, because Vulkan leaves an out-of-range integer attachment write undefined. Those packings apply one limit to all four channels, which can't express 10/10/10/2. Two new packings,UintMask10_10_10_2andUintClamp10_10_10_2, limit the first three channels to 10 bits and the fourth to 2.NarrowUintPackingpicks them forA2B10G10R10_UINT.32_ARstays unpacked, as it is for every UINT target.The hardware result for a word wider than a 10- or 2-bit channel is not measured. The debt entry says the new packings follow the Navi21 8- and 16-bit measurement.
Tested
11-20, title run past the stop:
main93f62d93f8plus #22534, this PR, #22778, #23864, #23880, #22690 and #22703 (all mine) runs Crimson Desert (PPSA25286) for the whole 602 s and reaches the settings menu over the title screen at about 1.7 fps (shot at 600 s, D#16802 post). All 12 rotation runs onmainsince 11-19 end on the format-71 cube store #22534 fixes, before this PR's draw, 196 to 301 s in. I haven't checked which of the other six PRs that run needed.Linux (Ubuntu 26.04.1, kernel 7.0), GCC 15.2, Ninja, Release,
-DBUILD_TESTING=ON, RTX 4070 Ti on NVIDIA 615.71:agc_driver_graphics:A2B10G10R10_UINT_PACK32with identity mapping.UintMask10_10_10_2for32_R,UintClamp10_10_10_2for32_GR,32_ABGRandFP16_ABGR, andUintfor32_AR, and the blend is dropped.agc_driver_uint_color_targetdraws intoA2B10G10R10_UINT(tiled and linear) and reads each 10- and 2-bit field back:Uint;32_ABGR,32_GR) and the mask (32_R);It also draws through both new packings into
R32_UINTandR32G32B32A32_UINT, where the attachment can hold the whole word, so the 10- and 2-bit limits must come from the shader.main'sState.cppandSpirvModuleEmitter.cppand the new tests, both fail.Windows 11 (VM, GeForce GT 1030, WinLibs GCC 16.2, Ninja, Release,
ANYPS5_REQUIRE_VULKAN=1):agc_driver_graphicsandagc_driver_uint_color_targetpass 3 runs on fd2918a80e, the pre-squash commit with this tree.Crimson Desert (PPSA25286), Linux, RTX 4070 Ti: offline (
APS5_NET_DISCONNECTED=1), 22G cap. The title only reaches this draw with #22534, so both builds include it.Base:
5e54d3fb1e(mainb179497cf5plus #22534), warm cache, 300 s. Run 1 never reached the draw in 307 s. Run 2 failed presenting at 172 s, after its second present:[gpu] driver failure: AGC graphics: unsupported color format 9 number type 4 component swap 0, thenEXIT-134.This PR:
644f249933(main9f75bf0be3plus #22534 plus this change), 420 s. The cold-cache run never presented. The warm run had no colour-format error, presented twice and ran on to 413 s. Its log shows work neither base run reached: seven2D read of the 2D array ... built from slice 0 alonelines, ahas 2 dynamic-resolution variants in one image tableline, two more sampled-texture budget updates, and two more shaders prepared at use. It then stopped on something else:guest allocation 0x20037d0000+0x10000 is still pinned by GPU work or an import (waited 60000 ms for the lease).The screen is black after the first present in every run, so I'm not claiming visible progress.
git merge-treeagainstmainis clean.tools/check_conventions.pypasses on the branch and this body, andtools/debt_fold.py --checkreports nothing new for this fragment.rafaconvaitis's Windows + AMD run of
4be6c4a707merged ontomain9a50e1014e(Radeon 760M, AMD Software 26.11.2, WinLibs GCC 15.2.0, Khronos validation layer 1.4.363):agc_driver_uint_color_targetpasses 3/3 on both sides with noVUID-lines.Colewiz7's RADV run of
4be6c4a707merged ontomain26604382a5ase2caaa4abd(Linux 7.3.4, GCC 16.2.1, Mesa 26.2.6, RX 7900 XT and the Ryzen 7 7800X3D iGPU, Khronos validation layer 1.4.363.1): no new failures againstmainand noVUID-orSYNC-HAZARDlines.domx4q's Linux + NVIDIA run with the validation layer of
4be6c4a707merged ontomainfbaae8a79d(Arch Linux, GCC 16.2.1, RTX 4090, NVIDIA 620.70.06, Khronos validation layer 1.4.363.1):agc_driver_graphicsandagc_driver_uint_color_targetpass on both sides with noVUID-lines. Withmain'sState.cppandSpirvModuleEmitter.cppand this PR's tests,agc_driver_uint_color_targetfails withunsupported color format 9 number type 4 component swap 0.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T00:47:00Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing in the inspected changes blocks merge; the new UINT format decoding and per-channel shader packing are consistently represented in state decoding, specialization, serialization, and execution tests.
What I ran
Reviewed head
4be6c4a7070423af688cedeff654da50129a160a. No commands or tests were run; the author reports GPU and title runs in the PR description, which were not independently reproduced.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded from the review folder because it exceeded the size limit. Its changed lines were visible in the diff, but its full text was not read. The reported build, GPU runs, negative control, and Crimson Desert behavior were not independently verified. Files read:description.md,commits.md,manifest.json,diff.patch,State.cpp,UintColorTarget.cpp,RequestSerializer.cpp,FragmentOutputSpecialization.hpp,Recompiler.hpp, andSpirvModuleEmitter.cpp. Excluded changed file:Graphics.cpp.To get this to a good state
Nothing is required.