Skip to content

fix(libSceAgcDriver): accept FP16_ABGR exports into unsigned integer targets - #12795

Closed
slopgobblercobbler wants to merge 1 commit into
boykopovar:mainfrom
slopgobblercobbler:fix/agc-driver-fp16-export-uint-target
Closed

slopgobblercobbler wants to merge 1 commit into
boykopovar:mainfrom
slopgobblercobbler:fix/agc-driver-fp16-export-uint-target

Conversation

@slopgobblercobbler

Copy link
Copy Markdown
Contributor

What

Accept FP16_ABGR (export format 4) into unsigned integer color targets without throwing, retaining the unpacked float export path (color.packing = None, state.blendEnable = VK_FALSE), resolving the start-up abort regression from #9789.

Unblocks Marvel's Guardians of the Galaxy (PPSA01748) which was aborting before start-up menus on an 8-bit unsigned integer color target (VK_FORMAT_R8_UINT), as well as Grand Theft Auto V (PPSA04264), Minecraft (PPSA17221), and Builder's Journey (PPSA05496).

Tested

core/libs/prx/libSceAgcDriver/tests/Graphics.cpp uintTargetTests() verifying acceptance of FP16_ABGR into 32-bit and 8-bit unsigned integer targets (VK_FORMAT_R8_UINT) with ColorExportPacking::None and disabled blending, and rejecting format 5 (UNORM16_ABGR). Conventions check verified with zero findings.

Checklist

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line fix error Closes an issue (Fixes #N) labels Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 12568 docs/dev/debt/libSceAgcDriver.md L92-93

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.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6185 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6743 docs/dev/debt/libSceAgcDriver.md
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6959 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7085 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7978 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8319 docs/dev/debt/libSceAgcDriver.md
PR 8395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9020 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9335 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9432 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9489 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9508 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9700 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9712 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9748 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9875 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9891 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9892 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9893 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9897 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9950 docs/dev/debt/libSceAgcDriver.md
PR 10049 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10064 docs/dev/debt/libSceAgcDriver.md
PR 10193 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10233 docs/dev/debt/libSceAgcDriver.md
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 10351 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10435 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10472 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11280 docs/dev/debt/libSceAgcDriver.md
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11557 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12662 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@slopgobblercobbler thanks, the scope is exactly the one pair and the decode test fails on main as it should. Two independent reviews reached the same conclusion; five requests:

  1. Make the fragment output match the attachment. With color.packing = None and uintExport false, the fragment shader keeps a float4 output (ShaderValidation.cpp:731-733 demands vertex:f32x4 for it) while the attachment is R8_UINT/R32_UINT. Vulkan needs the output component type to match the attachment's numeric class; otherwise the values written are undefined. The raw 32-bit exports avoid this through the Uint packing (bits retyped to uint4) and UINT16_ABGR through uintExport. Please give FP16_ABGR into a UINT target a defined path (for example export uint4 with the conversion you intend) or explain how the float4 output reaches the integer attachment defined. If a defined path isn't feasible yet, keeping the refusal for this pair is fine too. Whatever conversion you pick must also be part of the shader / prepared / disk-cache identity, so a float and a uint variant of the same shader can't share an entry.
  2. Say what the hardware does, or say "assumed". What the CB does with an FP16_ABGR export into a UINT channel (reinterpret the half bits, convert float to integer, clamp) is not stated anywhere in the PR or the debt entry. A source (ISA text, a capture, a console run) would settle it; otherwise the debt entry should say the chosen conversion is assumed.
  3. Draw it once. uintTargetTests only checks the decoded state. Please add (or point to) a draw of an FP16_ABGR export into R8_UINT and R32_UINT read back, run with the Khronos validation layer, and the PPSA01748 start-up result you describe (the body says GPUs tested: n/a).
  4. Debt doc. The rewrite of the UINT color targets entry also drops sentences about the existing 32-bit path (bit-for-bit readback, the 0-255 range for R8_UINT, an out-of-range value being left to the attachment's undefined conversion and untested, and the lavapipe -0.0 note that explains the pair left out of the test). Please restore them and only add the FP16_ABGR sentence.
  5. Drop the new UNORM16_ABGR throw assertion. The project's test policy doesn't allow a test to pin a valid guest form as a refusal; cover the pair you implement positively instead.

@slopgobblercobbler

Copy link
Copy Markdown
Contributor Author

@oneandonlydean Thank you for the thorough and illuminating review.

You've highlighted the exact architectural requirement: without a defined recompiler conversion emitting uvec4 (and tracking that conversion in the shader pipeline and disk-cache key), passing float4 outputs to R8_UINT/R32_UINT integer attachments violates Vulkan attachment class rules and produces undefined behavior. Furthermore, because console hardware behavior for FP16_ABGR into integer targets (raw bitcast vs float-to-uint conversion) is not yet verified on hardware, any synthetic conversion would be an assumption.

Given the project's strict conventions on verified guest ABI and well-defined Vulkan execution, keeping the refusal until console behavior is measured is the correct decision. Closing this PR in favor of tracking the hardware measurement in #12639.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix error Closes an issue (Fixes #N) unblocks title Names a title ID on the Unblocks line

Projects

None yet

2 participants