feat(agc): truncate exports into 10_11_11 unorm targets with ROUND_MODE set #23281
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23281"
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 Colewiz7 on 2026-11-18T21:43:37Z.
What
A 10_11_11 UNORM color target with
CB_COLOR_INFO.ROUND_MODEset is drawn with truncated exports instead of refused (truncating (ROUND_MODE) 10_11_11 unorm color targets are unsupported). It is the same change #23258 makes for 4_4_4_4:State.cppgives the target the packingUnorm10_11_11Truncated, and its exports pack each field asfloor(clamp(v, 0, 1) * max)(2047 for the 11-bit fields, 1023 for the 10-bit one), NaN to 0.Measured on a 7800X3D iGPU (gfx1036) with a local Mesa 26.0.6 RADV patched to give
COLOR_10_11_11the UNORM number type, RB+ off and 32_ABGR exports:ROUND_MODE0ROUND_MODE10x3f7fffff(0.99999994)0x7ff/0x3ff0x7fe/0x3fe0x7ff/0x3ff0x7ff/0x3ffTested
Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV,
main67d3465feb. The branch carries #23206's and #23258's commits first.agc_driver_packed_unorm_color_targetruns its cases again on a tiled target withROUND_MODEset, against a truncating reference.agc_graphics_profile_drawdecodes the target asUnorm10_11_11Truncatedinstead of expecting the refusal.a 32_ABGR export of (0, 1, 0.5) into a tiled ROUND_MODE 1 10_11_11 unorm target: pixel (0, 0) inside the scissor holds 0x803ff800, expected 0x7ffff800.agc_driver_packed_unorm_color_target,agc_driver_packed_unorm4444_color_target,agc_driver_packed_float_color_targetandagc_graphics_profile_draw, run withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layerandctest -V: 4/4 on both GPUs, layer 1.4.363.1 inserted, 0VUID-lines.ctest -R '^agc'(1936 tests): the failures matchmain's on each GPU.Not tested: gfx1013, Windows, NVIDIA. PS4 (GCN) targets don't read
ROUND_MODE, which the debt entry records.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-19T05:39:58Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; one review completeness limitation prevents a formal approval.
What I ran
Reviewed head
aef630fb95d70420390000b93e5074884f939a88throughrepo_read.py. No commands or tests were run; the reported GPU test results come from the PR description.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppis marked too large for the review folder. I inspected its relevant changed test ranges through the pinned reader, but did not read the complete file. Other changed files listed as included inmanifest.jsonwere read. Hardware behavior and reported test runs were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Jazeupoi on 2026-11-19T10:54:12Z.
Review: COMMENTED
Ran it on NVIDIA and Windows, which the description lists as not tested. #23258's 4_4_4_4 part already has NVIDIA runs on its own thread, so the new part here is the 10_11_11 one (
agc_driver_packed_unorm_color_target).Setup: Windows 11 Pro (build 26300), NVIDIA GeForce RTX 2060 (driver 621.24), WinLibs GCC 15.2.0 r7, Release. Base
maincac6e5714dwith #22373 (it only addssetenvfor the AGC tests on Windows); "this PR" is the same tree with headaef630fb95merged (clean; it carries #23258's commits).ctest -R "packed_(unorm|unorm4444|float)_color_target|packed_unorm4444_(multisample_)?partial_write|graphics_profile_draw" -V -j1, 3 runs each, withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1:not foundlinesVUID-(
agc_graphics_profile_drawcreates no Vulkan device.)The base runs its own versions of the tests, so as a control I built this PR's five execution tests against
main's versions of the seven non-test files the PR changes. I keptRecompiler.hppfrom the PR, because the tests name the newColorExportPackingvalues. Four of five fail:agc_driver_packed_unorm_color_target:AGC graphics: truncating (ROUND_MODE) 10_11_11 unorm color targets are unsupportedagc_driver_packed_unorm4444_color_targetandagc_driver_packed_unorm4444_partial_write: the same for 4_4_4_4agc_driver_packed_float_color_target:a 32_ABGR export of (nan, nan, nan) into a tiled 11_11_10 float target: pixel (0, 0) inside the scissor holds 0xfa1f07ff, expected 0xfc1f83f0agc_driver_packed_unorm4444_multisample_partial_writepasses either way. The 10_11_11 control fails when the target is decoded, before anything is drawn. So on this GPU it shows that the test reaches the new path, not that it would catch a wrong truncated value.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T02:50:43Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes support the stated truncation behavior; no blocking defect was verified, though one changed test file was unavailable for review.
What I ran
No commands or tests were run. I inspected the prepared diff and source at head
f792af8f144ad33630fdf77f1f4cc9261099c926using therepo_read.pyreader interface.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded as too large for the review folder. Its changed lines were inspected, but its full text was not read. The remaining included changed files were reviewed. Tests, CI output, console behavior, and the author’s reported measurements 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-03T21:59:17Z.
Review: COMMENTED
The current stack conflicts with
main63db72fb61inGraphics.cppand three shader format/serialization files. Please resolve #23258 first, then carry forward the distinct 10_11_11 packing and the existing 4_4_4_4 mode. Keep the 11-bit versus 10-bit truncation boundary checks on the rebased branch. The paired Vulkan run is pending the merge resolution.AI-assisted: yes.
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.