Repository navigation
feat(agc): draw into 2_10_10_10 UINT color targets - #22609
Conversation
CB_COLOR_INFO FORMAT 9 (2_10_10_10) with NUMBER_TYPE 4 (UINT) and COMP_SWAP 0 threw "unsupported color format 9 number type 4 component swap 0". It now decodes to A2B10G10R10_UINT_PACK32, which keeps red in the low bits as the UNORM twin does. Raw 32-bit exports into narrow UINT channels are masked (32_R) or clamped (32_GR, 32_ABGR, FP16_ABGR) in the shader, since Vulkan leaves an out-of-range integer attachment write undefined. Those packings used one limit for every channel. The new UintMask10_10_10_2 and UintClamp10_10_10_2 packings limit the first three channels to 10 bits and the fourth to 2 bits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
|
Windows + AMD run; I found no AMD run in the description or in the comments. Head Setup: Windows 11 25H2 (build 26200), AMD Radeon 760M integrated graphics (
AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above). |
|
Thanks @rafaconvaitis for the Windows + AMD run with the validation layer, the first AMD result on this PR. I've added it to the Tested section, linked to your comment, and the Radeon 760M to the GPUs tested line. |
MarcZX10
left a comment
There was a problem hiding this comment.
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
| Check | Result | Note |
|---|---|---|
| Source review | passed | Core implementation and execution test inspected |
| Automated checks | not run | No local command execution available |
| Merge preview | not run | Author reports a clean merge-tree |
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was 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, and SpirvModuleEmitter.cpp. Excluded changed file: Graphics.cpp.
To get this to a good state
Nothing is required.
|
Head No new failures and no new validation messages on either GPU.
Layer runs used AI-assisted: yes |
|
Thanks @Colewiz7 for the RADV run on the RX 7900 XT and the 7800X3D iGPU with the validation layer. I've added it to the Tested section, linked to your comment, and both GPUs to the GPUs tested line. |
|
Ran the focused tests with the Khronos validation layer on Linux and an NVIDIA GPU, since CI runs the GPU tests only on lavapipe and the RTX 4070 Ti run in the Tested section does not use the layer; the other runs are Windows AMD and RADV. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor
Every device selected the RTX 4090; Negative control: with main's No new AI-assisted: yes (Claude Code) |
|
Thanks @domx4q for the RTX 4090 run with the validation layer, the first layered NVIDIA result on this PR, and for the negative control. I've added it to the Tested section, linked to your comment, and the 4090 to the GPUs tested line. |
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 GTA V (PPSA04264) stops before the menu: color export format 4 into an unsigned integer target is unsupported #11513 and fix(libSceAgcDriver): store 32-bit exports into narrow UINT targets as Navi21 does #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 fd2918a, 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(mainb179497 plus fix(shader): give converted image stores the cube-face mode again #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(main9f75bf0 plus fix(shader): give converted image stores the cube-face mode again #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)