feat(agc): average the samples of an 11_11_10 float CB resolve #23225
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23225"
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 Callimann8 on 2026-11-18T20:31:55Z.
What
PPSA12361 stops on
AGC graphics: CB resolves of 11_11_10 float color targets are unsupported(#11362). The target is an R32_UINT image, and a subpass resolve takes one sample of an integer format, so the resolve was refused.This resolves a multisampled 11_11_10 float source with a fragment pass instead. It reuses
FirstSampleCopywith a newPACKED_SAMPLESvariant ofFirstSample.frag. For each channel (10 bits at 0, 11 at 10, 11 at 21, the export layout) the pass sums the samples exactly in 64-bit integer units of the smallest subnormal step, divides by the sample count with a shift, and truncates the quotient back to the small float. Any NaN sample gives the canonical NaN (0x7e0for an 11-bit channel,0x3f0for the 10-bit one), ahead of infinity, and an infinite sample gives infinity. This matches the gfx1036 measurements in #11362.RecordIntodraws into the destination's attachment view, through the recorder or a batch. The decoder only accepts it when the source and destination both have the 11_11_10 float layout with the same component order, since 11_11_10 float, 10_11_11 unorm and plain 32-bit uint targets all decode toVK_FORMAT_R32_UINT. The refusals for 10_11_11 unorm and 4_4_4_4 resolves stay.The debt entry for the 11_11_10 float CB resolve records that only gfx1036 was measured.
Tested
Linux (Ubuntu 24.04), GCC 13, Release, lavapipe (llvmpipe, Mesa 25.2.8). Not tested on a title.
agc_driver_packed_float_color_target_tests: new cases draw a different value into each sample of an 11_11_10 float target, resolve it, and check every texel. A 4-sample case covers a red average halfway between two steps (truncated, not rounded to even) and a subnormal blue average. A 4-sample case with NaN and infinite samples expects the canonical NaN ahead of infinity; the earlier float32 version of this pass gives0xfe1f03f8instead of0xfc1f03f0there. An 8-sample case uses values whose float32 sum rounds up across a step (0x730) while the exact sum gives0x72f; lavapipe has no 8-sample color attachments, so it is skipped there. lavapipe has no 2-sample color attachments either, so the other cases use 4 samples. With the averaging pass turned off, the subpass resolve gives0x041081e1instead of0x030fc1e1.agc_driver_graphics_tests: the decode test now expects the 11_11_10 float resolve to decode, and the 10_11_11 unorm one to still be refused. New cases refuse a resolve between an 11_11_10 float target and a 10_11_11 unorm one in either direction, and between two 11_11_10 float targets with different component orders; without the layout check they decode. It passes.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, the loader inserted the layer. The only VUID reported isVUID-VkDeviceCreateInfo-pNext-pNext, from the older installed layer (1.3.275). No VUID comes from the resolve.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-18T22:02:14Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected code adds a shader resolve for 11_11_10 float targets, and I found no concrete blocking defect; runtime checks were not run.
What I ran
Read the prepared diff at head
759c274562b78e606d243020fb2eb347ba9941b7, the description, commits, and manifest. Read changed code and relevant context throughrepo_read.py. No commands or tests were run.Results
Findings
Blocking
None identified in the code inspected.
Non-blocking
Runtime behavior on the stated lavapipe setup and other GPUs remains unconfirmed by this review.
Not verified
I read the changed sections of all listed files, including the changed lines in
tests/Graphics.cppvia the pinned reader. I did not read complete large files or run tests, builds, or validation. The PR description’s test results are author-reported, not independently verified.To get this to a good state
Nothing is required. Optional: run the reported execution and graphics tests on the exact head and attach the results.
Imported from boykopovar/AnyPS5. Originally posted by thalesdot1dot1 on 2026-11-19T02:35:17Z.
Review: COMMENTED
Reviewed
759c274562. I left one finding about the guest color layout accepted by the packed resolve. This was a static review. AI-assisted with Codex.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T07:28:16Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the reviewed code supports the documented resolve behavior, though test execution and one changed file remain unverified.
What I ran
Reviewed head
65fe89b79025d5b237d8bc514f06209826ab030ausing the prepared diff andrepo_read.py. No build or tests were run. The PR description reports Linux/lavapipe tests; those results were not independently run here.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppis excluded from the prepared bundle, but its changed lines were read through the repository reader. All files markedincluded: truein the manifest were read; the changed test file was inspected only at its changed range. The complete test suite and console/title behavior were not run. No build or validation-layer checks were run.To get this to a good state
Nothing is required.