fix(agc): match the measured CB conversion of 11_11_10 float color targets #23206
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23206"
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-18T20:16:12Z.
What
Two changes to 11_11_10 float color targets, both from one measurement of the CB on RDNA2:
CB_COLOR_INFO.ROUND_MODEclear decodes like one with it set. The refusalrounding (ROUND_MODE 0) 11_11_10 float color targets are unsupported(a518a90ad6) assumed the bit makes the CB round. It doesn't.0x3f0(10-bit field) or0x7e0(11-bit field) for every NaN.PackExportused to keep the top payload bits, asF32BitsToSmallFloatRtzdoes for image stores, which this PR leaves unchanged.Measured on a 7800X3D iGPU (gfx1036) with a local Mesa 26.0.6 RADV patched to force
COLOR_11_11_10, RB+ off (gfx1013 has none) and 32_ABGR exports:ROUND_MODE0ROUND_MODE10x3df/0x7bf0x3e0/0x7c00x7f800001,0x7fa00000,0x7fe00000,0x7fffffff,0xff800001and 4 more0x3f0/0x7e0The same NaNs drawn into an
R32_SFLOATtarget come back unchanged, so the CB is what rewrites them.SIMPLE_FLOATandBLEND_BYPASSchange nothing. On a 4_4_4_4 UNORM target in the same setupROUND_MODE0 rounds and 1 truncates, so the bit itself works. The resolve of this format, measured with the same probe, is in #11362.Tested
Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV,
main533edafcac.agc_driver_packed_float_color_targetgains two NaN payload cases and aROUND_MODE0 pass.agc_graphics_profile_drawnow decodes theROUND_MODE0 target instead of expecting the refusal.main's sources both fail on both GPUs: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 0xfc1f83f0, androunding (ROUND_MODE 0) 11_11_10 float color targets are unsupported.agc_driver_packed_float_blend, run withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layerandctest -V: 3/3 on both GPUs, layer 1.4.363.1 inserted, 0VUID-lines on this PR and onmainf15df3256c.ctest -R '^agc'(1936 tests): the failures matchmain's exactly on each GPU.Not tested: gfx1013, Windows, NVIDIA, and NaN through a blend or partial write, which goes through the same
PackExport.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-18T21:02:37Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and added test cases are consistent with the stated measured behavior.
What I ran
Reviewed head
5bdd418f61a2f809ddb5272ccc5aa099ccbc41fcagainst the prepared diff. I did not run programmatic checks. The author reports running GPU tests and theagcsuite; those results were not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp,core/libs/prx/libSceAgcDriver/tests/execution/PackedFloatColorTarget.cpp,core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp, anddocs/dev/debt/changes/agc-11-11-10-float-cb-conversion.md. The included changed lines and targeted context were inspected.files.jsonwas not available from the reader; the manifest/listing identifycore/libs/prx/libSceAgcDriver/tests/Graphics.cppas excluded from the review folder, so I read its changed hunk through the pinned reader. GPU behavior, other vendors and platforms, and the reported test runs were not independently verified. No negative control was run.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T04:39:09Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the author’s measurements and the inspected implementation support the stated behavior.
What I ran
Reviewed head
8b49658de9df5881f6e599ddd3ef55258e99fdbdusingrepo_read.py. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not run tests or independently verify the reported GPU measurements. The PR reports testing on two AMD GPUs; gfx1013, Windows, NVIDIA, and NaN through blending or partial writes were not tested by the author. Read:
State.cpp,Graphics.cpp(changed lines),PackedFloatColorTarget.cpp,SpirvModuleEmitter.cpp, andagc-11-11-10-float-cb-conversion.md. No changed files were excluded from review;Graphics.cppwas read at its changed lines only.files.jsonwas not available as a review-folder document.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-11-24T19:30:37Z.
Review: APPROVED
Reviewed exact head
8b49658de9df5881f6e599ddd3ef55258e99fdbd.The production delta is narrowly scoped and matches the measured CB behavior. Removing the
ROUND_MODE 0refusal is backed by the same truncating conversion on both bit values, while the shader-side NaN canonicalization is restricted toFormat10_11_11Floatcolor exports: the unsigned-NaN test usesabs(bits) > 0x7f800000, so positive and negative NaNs both select the canonical field, and(0x1f << mantissaBits) | (1 << (mantissaBits - 1))produces the measured0x3f010-bit and0x7e011-bit encodings. Image-store conversion remains unchanged.The regression covers multiple NaN payload/sign patterns and the formerly rejected ROUND_MODE 0 path. Independent AMD evidence exists on Linux/RADV and Windows/LLPC, including an old-production negative control for the NaN result; the focused packed-float tests pass on the exact head, and all hosted exact-head checks are terminal/successful (with the unrelated matrix jobs intentionally skipped). MarcZX10 also approved this exact head.
No blocking finding from me.
AI-assisted: yes