fix(libSceAgcDriver): export raw 32-bit values into UINT color targets as integers #9789

Merged
rooklz merged 1 commit from upstream-pr/9789 into main 2026-10-26 11:48:04 +00:00
rooklz commented 2026-10-22 15:05:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-22T15:05:17Z.


What

A pixel shader that exports raw 32-bit values (32_R, 32_GR, 32_AR, 32_ABGR) into a color target whose number type is UINT reached Vulkan as a float4 output on an integer attachment: State.cpp picked the UINT attachment format from the target, but only a UINT16_ABGR export (uintExport) made the fragment output uint4. NVIDIA and AMD drivers write the float's bits, which is what the console's CB stores for 32-bit channels, but Metal refuses the pipeline, so on macOS two catalog titles stop at their first draw (#9783):

[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 3):
output of type float4 is not compatible with a MTLPixelFormatRGBA32Uint color attachment
[gpu] driver failure: AGC graphics: vkCreateGraphicsPipelines: Vulkan result -3

(PPSA99313 Doom 3 BFG, COLOR_32_32_32_32 UINT; PPSA59322 ccleste the same with COLOR_8 UINT and MTLPixelFormatR8Uint.)

The fragment-output specialization already retypes a float4 output to uint4 with a bitcast for the two word-packed targets (Unorm10_11_11, Float11_11_10). This adds a third kind, Uint, that does only that retype. DecodeColorFormat sets it for every UINT number type whose decode has no packing of its own, the UINT16 export keeps its existing uintExport path (the output is already uint4 there, so the packing is cleared), and the other 16-bit export formats into a UINT target throw as the packed targets do. The rules that only make sense for packed targets, no partial writes, no blending, no DCC and no CB resolve, stay on the packed kinds (Unorm10_11_11, Float11_11_10 and, since #8563, Unorm4_4_4_4) through WordPacked; Uint is the last enumerator, after #8563's.

Blending on a UINT target is dropped at decode: the Vulkan framebuffer chapter says Blending is only defined for floating-point, UNORM, SNORM, and sRGB formats, Metal refuses it, and Doom 3 BFG has it enabled on that same target. A CB resolve whose source is a UINT target keeps working: the resolve guard that refuses the two word-packed sources now tests WordPacked instead of any packing, with a decode case for a UINT-source resolve. The debt entry records what is not measured on a console: the CB's conversion of a raw export into 8- and 16-bit UINT channels and whether it blends into integer targets.

Tested

  • Windows 11 Pro, AMD Radeon RX 6600 XT (Navi 23), AMD driver 32.0.21045.16010, WinLibs GCC 15.2.0, Release, Vulkan SDK 1.4.363, with the Khronos validation layer, by @brummilab on head b15a58d802 merged onto main 29ce6d87e: agc_driver_uint_color_target passes, and neither arm shows a VUID- message.
  • macOS 26.2, Apple M5, Apple clang 21, x86-64 under Rosetta 2, MoltenVK, on @mugurc's ci/macos-series-2 integration tree at 53db0badb with #7524, the code of #7937 and the libSceSsl change of #7332: the two titles: PPSA99313 Doom 3 BFG on that tree without this change dies at its first rect-list draw with the lines above; with it the pipeline compiles and the title runs through to its own data check and exits 0 (Sys_Error: Could not load default font, #9787). PPSA59322 ccleste moves from the same compile error to the MoltenVK barycentric gap noted on #1 (#9788). MoltenVK still prints Blending is enabled for attachment with format VK_FORMAT_R8G8B8A8_UINT, which does not support it for these targets: its MVKPipeline.mm prints that for every attachment whose format cannot blend, whatever blendEnable says, and a log line I added before vkCreateGraphicsPipelines confirmed no integer attachment reached it with blending on. agc_driver_packed_float_color_target and agc_driver_packed_unorm_color_target pass 3 of 3 on MoltenVK with the corrected SelectExportPacking, and both title results above were re-run on that code with the same outcome; the integration tree is older than main and cannot build the new execution test or run agc_driver_graphics_tests to the new checks (it stops earlier on a check of main's test file against the tree's older State.cpp), so those two are covered by the hosted run below.
  • Linux, hosted runner (Ubuntu 24.04, GCC, Release, lavapipe): the verify run on my fork on fced1e175d, the head before the resolve-guard change, fails the job on any ctest failure and passes agc_driver_graphics (with uintTargetTests), agc_driver_graphics_maps_fallback, agc_driver_uint_color_target (the new execution test), agc_driver_packed_float_color_target, agc_driver_packed_unorm_color_target, agc_driver_packed_unorm4444_color_target and the shader_recompiler tests. Its only failure, agc_driver_sgpr_pattern_fill_keys, fails the same way on main on that runner (the base side of https://github.com/rooklz/AnyPS5/actions/runs/39845397298). The same run on the current head f23f7dcd90, rebased over #8563, is https://github.com/rooklz/AnyPS5/actions/runs/40010114899 (and on 05a84816f6 before it, https://github.com/rooklz/AnyPS5/actions/runs/39982371741): every targeted test passes, and its two failures, agc_driver_queued_index_read_order and agc_driver_sgpr_pattern_fill_keys, are main's on that runner. An earlier version of this section called a run on 81d67188b6 passing when its log had the new execution test failing: SelectExportPacking in the SPIR-V backend packed every non-None kind as a word, so a UINT target received the 10_11_11 UNORM packing of the float instead of its bits; @adriadam10 found it in that log.
  • Linux x86-64 container (Ubuntu 24.04, GCC 13.3, Release, llvmpipe), head b15a58d802: agc_driver_uint_color_target passes with every case above (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1). Hosted Linux runner (Ubuntu 24.04, GCC, Release, lavapipe), verify run on my fork on the head: every targeted test passes, including the new cases; its one failure, agc_driver_sgpr_pattern_fill_keys, is main's on that runner (as in the earlier run on e6053f72b8, where main's agc_driver_queued_index_read_order also failed on both sides).
  • agc_driver_graphics_tests gains uintTargetTests: a COLOR_32 UINT target decodes to R32_UINT with the Uint packing and its blend dropped, COLOR_8 UINT to R8_UINT the same, a UINT16_ABGR export keeps uintExport with no packing, an FP16_ABGR export into it is refused, and a 32-bit float target keeps no packing. The new agc_driver_uint_color_target_tests draws eight 32-bit words (0, 1, the bits of 1.0f, a quiet NaN, negative infinity, negative zero, 0xdeadbeef, 0xffffffff) through each raw 32-bit export into tiled and linear targets and reads every written channel back bit for bit, the way agc_driver_packed_float_color_target_tests does for the 11_11_10 target: 32_R into R32_UINT, 32_GR into R32G32_UINT, 32_AR (red and alpha written, green and blue kept) and 32_ABGR into R32G32B32A32_UINT, and 32_R values 0 to 255 into R8_UINT, ccleste's target. Channels outside the write mask and pixels outside the scissor must keep their earlier bytes. What an 8- or 16-bit UINT channel keeps of a value it cannot hold is the Vulkan attachment's conversion, which Vulkan leaves undefined; it is untested here and unmeasured on a console, as the debt entry says.
  • lavapipe drops the sign of a zero in one case: with a constant export of exactly 1.0 in the first channel and -0.0 in the second, it stores +0.0 in the second channel, although the module declares SignedZeroInfNanPreserve 32. I checked the IR after each front-end pass, the SPIR-V the test materializes (the -0.0 reaches the store as OpBitcast %float %uint_2147483648) and a run with APS5_SPIRV_OPT=none; it stays, and {-0.0, -0.0}, {+0.0, -0.0}, {1.0, 0x80000001} and {0x3f800001, -0.0} all store correctly, so the multi-channel rows rotate the words so that pair never meets and the debt entry records it. It is a lavapipe behaviour, not this change's: the same values through 32_R and every other pairing are bit-exact.
  • Windows 11, Core i7-13650HX, NVIDIA RTX 4060 Laptop GPU (driver 610.62), WinLibs GCC 15.2.0, Release, Khronos validation layer on, by @valenciana-nc on f9b349a056 merged onto main c383e3772b: agc_driver_graphics, agc_driver_packed_float_color_target, agc_driver_packed_unorm_color_target and agc_driver_uint_color_target pass 3 of 3 each with no validation message; main passes the first three. PPSA59322 ccleste reaches its first level on main and with this change (two runs each, A/B/B/A, natural exit 0); main logs six Undefined-Value-ShaderFragmentOutputMismatch-DynamicRendering warnings for the float output into R8_UINT, and this change logs none (details on #9788).
  • Windows 11 Pro, AMD Radeon RX 6600 XT (driver 32.0.21045.16010), WinLibs GCC 15.2.0, Release, by @brummilab on f23f7dcd90 merged onto main fa515def8: agc_driver_graphics, agc_driver_uint_color_target and the three packed-target execution tests pass 5 of 5; main passes its 4. The validation layer did not load on that machine, so no validation result.
  • check_conventions.py passes. pr_overlap.py reports #8563 and #8564 (4_4_4_4 UNORM packings) in DecodeColorFormat and #8658 next to the uintExport line; none implements this, and whichever lands second rebases a few lines.
  • GPUs tested: Apple M5 through MoltenVK (macOS); lavapipe on the hosted Linux runner; NVIDIA RTX 4060 Laptop (driver 610.62, Windows 11) by @valenciana-nc, see below; AMD RX 6600 XT by @brummilab.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: #9783
  • Unblocks: PPSA99313 #9787, PPSA59322 #9788
  • GPUs tested: AMD Radeon RX 6600 XT, AMD driver 32.0.21045.16010, Windows 11 (by @brummilab); Apple M5 (MoltenVK, macOS 26.2), lavapipe (Mesa, hosted Ubuntu 24.04), NVIDIA RTX 4060 Laptop (driver 610.62, Windows 11, by @valenciana-nc), AMD RX 6600 XT (driver 32.0.21045.16010, Windows 11, by @brummilab)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4969552532 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-22T15:05:17Z. --- ### What A pixel shader that exports raw 32-bit values (`32_R`, `32_GR`, `32_AR`, `32_ABGR`) into a color target whose number type is UINT reached Vulkan as a `float4` output on an integer attachment: `State.cpp` picked the UINT attachment format from the target, but only a `UINT16_ABGR` export (`uintExport`) made the fragment output `uint4`. NVIDIA and AMD drivers write the float's bits, which is what the console's CB stores for 32-bit channels, but Metal refuses the pipeline, so on macOS two catalog titles stop at their first draw (#9783): ``` [mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 3): output of type float4 is not compatible with a MTLPixelFormatRGBA32Uint color attachment [gpu] driver failure: AGC graphics: vkCreateGraphicsPipelines: Vulkan result -3 ``` (PPSA99313 Doom 3 BFG, `COLOR_32_32_32_32` UINT; PPSA59322 ccleste the same with `COLOR_8` UINT and `MTLPixelFormatR8Uint`.) The fragment-output specialization already retypes a `float4` output to `uint4` with a bitcast for the two word-packed targets (`Unorm10_11_11`, `Float11_11_10`). This adds a third kind, `Uint`, that does only that retype. `DecodeColorFormat` sets it for every UINT number type whose decode has no packing of its own, the UINT16 export keeps its existing `uintExport` path (the output is already `uint4` there, so the packing is cleared), and the other 16-bit export formats into a UINT target throw as the packed targets do. The rules that only make sense for packed targets, no partial writes, no blending, no DCC and no CB resolve, stay on the packed kinds (`Unorm10_11_11`, `Float11_11_10` and, since #8563, `Unorm4_4_4_4`) through `WordPacked`; `Uint` is the last enumerator, after #8563's. Blending on a UINT target is dropped at decode: the Vulkan framebuffer chapter says `Blending is only defined for floating-point, UNORM, SNORM, and sRGB formats`, Metal refuses it, and Doom 3 BFG has it enabled on that same target. A CB resolve whose source is a UINT target keeps working: the resolve guard that refuses the two word-packed sources now tests `WordPacked` instead of any packing, with a decode case for a UINT-source resolve. The debt entry records what is not measured on a console: the CB's conversion of a raw export into 8- and 16-bit UINT channels and whether it blends into integer targets. ### Tested - Windows 11 Pro, AMD Radeon RX 6600 XT (Navi 23), AMD driver 32.0.21045.16010, WinLibs GCC 15.2.0, Release, Vulkan SDK 1.4.363, with the Khronos validation layer, by @brummilab on head `b15a58d802` merged onto `main` `29ce6d87e`: `agc_driver_uint_color_target` passes, and neither arm shows a `VUID-` message. - macOS 26.2, Apple M5, Apple clang 21, x86-64 under Rosetta 2, MoltenVK, on @mugurc's `ci/macos-series-2` integration tree at `53db0badb` with #7524, the code of #7937 and the libSceSsl change of #7332: the two titles: PPSA99313 Doom 3 BFG on that tree without this change dies at its first rect-list draw with the lines above; with it the pipeline compiles and the title runs through to its own data check and exits 0 (`Sys_Error: Could not load default font`, #9787). PPSA59322 ccleste moves from the same compile error to the MoltenVK barycentric gap noted on #1 (#9788). MoltenVK still prints `Blending is enabled for attachment with format VK_FORMAT_R8G8B8A8_UINT, which does not support it` for these targets: its `MVKPipeline.mm` prints that for every attachment whose format cannot blend, whatever `blendEnable` says, and a log line I added before `vkCreateGraphicsPipelines` confirmed no integer attachment reached it with blending on. `agc_driver_packed_float_color_target` and `agc_driver_packed_unorm_color_target` pass 3 of 3 on MoltenVK with the corrected `SelectExportPacking`, and both title results above were re-run on that code with the same outcome; the integration tree is older than `main` and cannot build the new execution test or run `agc_driver_graphics_tests` to the new checks (it stops earlier on a check of `main`'s test file against the tree's older `State.cpp`), so those two are covered by the hosted run below. - Linux, hosted runner (Ubuntu 24.04, GCC, Release, lavapipe): the [verify run on my fork](https://github.com/rooklz/AnyPS5/actions/runs/39864295356) on `fced1e175d`, the head before the resolve-guard change, fails the job on any ctest failure and passes `agc_driver_graphics` (with `uintTargetTests`), `agc_driver_graphics_maps_fallback`, `agc_driver_uint_color_target` (the new execution test), `agc_driver_packed_float_color_target`, `agc_driver_packed_unorm_color_target`, `agc_driver_packed_unorm4444_color_target` and the `shader_recompiler` tests. Its only failure, `agc_driver_sgpr_pattern_fill_keys`, fails the same way on `main` on that runner (the base side of https://github.com/rooklz/AnyPS5/actions/runs/39845397298). The same run on the current head `f23f7dcd90`, rebased over #8563, is https://github.com/rooklz/AnyPS5/actions/runs/40010114899 (and on `05a84816f6` before it, https://github.com/rooklz/AnyPS5/actions/runs/39982371741): every targeted test passes, and its two failures, `agc_driver_queued_index_read_order` and `agc_driver_sgpr_pattern_fill_keys`, are `main`'s on that runner. An earlier version of this section called a run on `81d67188b6` passing when its log had the new execution test failing: `SelectExportPacking` in the SPIR-V backend packed every non-`None` kind as a word, so a UINT target received the 10_11_11 UNORM packing of the float instead of its bits; @adriadam10 found it in that log. - Linux x86-64 container (Ubuntu 24.04, GCC 13.3, Release, llvmpipe), head `b15a58d802`: `agc_driver_uint_color_target` passes with every case above (`ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`). Hosted Linux runner (Ubuntu 24.04, GCC, Release, lavapipe), [verify run on my fork](https://github.com/rooklz/AnyPS5/actions/runs/40124429642) on the head: every targeted test passes, including the new cases; its one failure, `agc_driver_sgpr_pattern_fill_keys`, is `main`'s on that runner (as in the [earlier run](https://github.com/rooklz/AnyPS5/actions/runs/40121701295) on `e6053f72b8`, where `main`'s `agc_driver_queued_index_read_order` also failed on both sides). - `agc_driver_graphics_tests` gains `uintTargetTests`: a `COLOR_32` UINT target decodes to `R32_UINT` with the `Uint` packing and its blend dropped, `COLOR_8` UINT to `R8_UINT` the same, a `UINT16_ABGR` export keeps `uintExport` with no packing, an `FP16_ABGR` export into it is refused, and a 32-bit float target keeps no packing. The new `agc_driver_uint_color_target_tests` draws eight 32-bit words (0, 1, the bits of 1.0f, a quiet NaN, negative infinity, negative zero, `0xdeadbeef`, `0xffffffff`) through each raw 32-bit export into tiled and linear targets and reads every written channel back bit for bit, the way `agc_driver_packed_float_color_target_tests` does for the 11_11_10 target: `32_R` into `R32_UINT`, `32_GR` into `R32G32_UINT`, `32_AR` (red and alpha written, green and blue kept) and `32_ABGR` into `R32G32B32A32_UINT`, and `32_R` values 0 to 255 into `R8_UINT`, ccleste's target. Channels outside the write mask and pixels outside the scissor must keep their earlier bytes. What an 8- or 16-bit UINT channel keeps of a value it cannot hold is the Vulkan attachment's conversion, which Vulkan leaves undefined; it is untested here and unmeasured on a console, as the debt entry says. - lavapipe drops the sign of a zero in one case: with a constant export of exactly 1.0 in the first channel and -0.0 in the second, it stores +0.0 in the second channel, although the module declares `SignedZeroInfNanPreserve 32`. I checked the IR after each front-end pass, the SPIR-V the test materializes (the `-0.0` reaches the store as `OpBitcast %float %uint_2147483648`) and a run with `APS5_SPIRV_OPT=none`; it stays, and {-0.0, -0.0}, {+0.0, -0.0}, {1.0, `0x80000001`} and {`0x3f800001`, -0.0} all store correctly, so the multi-channel rows rotate the words so that pair never meets and the debt entry records it. It is a lavapipe behaviour, not this change's: the same values through `32_R` and every other pairing are bit-exact. - Windows 11, Core i7-13650HX, NVIDIA RTX 4060 Laptop GPU (driver 610.62), WinLibs GCC 15.2.0, Release, Khronos validation layer on, by @valenciana-nc on `f9b349a056` merged onto `main` `c383e3772b`: `agc_driver_graphics`, `agc_driver_packed_float_color_target`, `agc_driver_packed_unorm_color_target` and `agc_driver_uint_color_target` pass 3 of 3 each with no validation message; `main` passes the first three. PPSA59322 ccleste reaches its first level on `main` and with this change (two runs each, A/B/B/A, natural exit 0); `main` logs six `Undefined-Value-ShaderFragmentOutputMismatch-DynamicRendering` warnings for the float output into `R8_UINT`, and this change logs none (details on #9788). - Windows 11 Pro, AMD Radeon RX 6600 XT (driver 32.0.21045.16010), WinLibs GCC 15.2.0, Release, by @brummilab on `f23f7dcd90` merged onto `main` `fa515def8`: `agc_driver_graphics`, `agc_driver_uint_color_target` and the three packed-target execution tests pass 5 of 5; `main` passes its 4. The validation layer did not load on that machine, so no validation result. - `check_conventions.py` passes. `pr_overlap.py` reports #8563 and #8564 (4_4_4_4 UNORM packings) in `DecodeColorFormat` and #8658 next to the `uintExport` line; none implements this, and whichever lands second rebases a few lines. - GPUs tested: Apple M5 through MoltenVK (macOS); lavapipe on the hosted Linux runner; NVIDIA RTX 4060 Laptop (driver 610.62, Windows 11) by @valenciana-nc, see below; AMD RX 6600 XT by @brummilab. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: #9783 <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: PPSA99313 #9787, PPSA59322 #9788 <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: AMD Radeon RX 6600 XT, AMD driver 32.0.21045.16010, Windows 11 (by @brummilab); Apple M5 (MoltenVK, macOS 26.2), lavapipe (Mesa, hosted Ubuntu 24.04), NVIDIA RTX 4060 Laptop (driver 610.62, Windows 11, by @valenciana-nc), AMD RX 6600 XT (driver 32.0.21045.16010, Windows 11, by @brummilab) <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
rooklz commented 2026-10-22 15:31:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-22T15:31:32Z.


Head 1a57150054: the new execution test needs the recompiler's Optimization include directory like agc_driver_packed_float_color_target_tests does; the first hosted run failed to compile it for that reason. Same diff otherwise; the hosted run link in the description is the new one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6344616788 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#issuecomment-6344616788). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-22T15:31:32Z. --- Head `1a57150054`: the new execution test needs the recompiler's Optimization include directory like `agc_driver_packed_float_color_target_tests` does; the first hosted run failed to compile it for that reason. Same diff otherwise; the hosted run link in the description is the new one.
MarcZX10 commented 2026-10-22 15:53:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T15:53:58Z.

Review: CHANGES_REQUESTED


The exact-head C++20 syntax check found a blocking compile error in the new execution test. UintColorTarget.cpp opens an anonymous namespace at line 35, but it never closes it before defining main(); the file ends at line 281 still inside that namespace. Compiling the exact PR file with the repository headers fails with expected '}' at end of input (matching the namespace opened at line 35). Please close the helper namespace before main(), then rerun the focused target/build.

The hosted eligibility, conventions, labels and report checks pass, but the product build/test jobs are skipped, so they do not catch this compile failure. I ran only a syntax-only compile locally; no runtime test ran here.

After the fix, please consider adding a 32-bit raw export into an R8_UINT target to the execution test as well. The issue's ccleste case uses R8_UINT; the current execution test covers tiled and linear R32_UINT, while the 8-bit path is only covered by state-decode assertions and a title run that proceeds to a later failure.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5617040925 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#pullrequestreview-5617040925). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T15:53:58Z. **Review:** CHANGES_REQUESTED --- The exact-head C++20 syntax check found a blocking compile error in the new execution test. `UintColorTarget.cpp` opens an anonymous namespace at line 35, but it never closes it before defining `main()`; the file ends at line 281 still inside that namespace. Compiling the exact PR file with the repository headers fails with `expected '}' at end of input` (matching the namespace opened at line 35). Please close the helper namespace before `main()`, then rerun the focused target/build. The hosted eligibility, conventions, labels and report checks pass, but the product build/test jobs are skipped, so they do not catch this compile failure. I ran only a syntax-only compile locally; no runtime test ran here. After the fix, please consider adding a 32-bit raw export into an `R8_UINT` target to the execution test as well. The issue's ccleste case uses `R8_UINT`; the current execution test covers tiled and linear `R32_UINT`, while the 8-bit path is only covered by state-decode assertions and a title run that proceeds to a later failure.
MarcZX10 commented 2026-10-22 16:30:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T16:30:29Z.

Review: DISMISSED


The state decode and output specialization changes are consistent with the intended raw UINT path, and the new decode checks cover unsupported packed exports plus blend suppression. Current-main check_conventions.py and git diff --check pass. I did not build/run the Vulkan execution test locally. The fork verification workflow for the fix/agc-uint-color-export ref is still in progress at the time of this review; I have not counted its results as passing. The upstream PR checks themselves show eligibility/conventions/labels, while full product builds are skipped.

Two follow-ups before merge:

  • This head is eight commits behind live main (8499ea52e571b0edfc1feecfd3f6b9944012b359). CONTRIBUTING.md requires branches to be based on and kept up to date with main; please sync and rerun the checks on the final head.
  • The execution test bit-checks 32_R output into R32_UINT in tiled and linear layouts. The implementation also accepts 32_GR, 32_AR and 32_ABGR, while the decode unit tests currently check R32 and R8. Please add focused multi-channel execution coverage for those accepted export formats, or narrow the supported-format claim to the formats covered by the evidence.

The issue #9783 is open and correctly linked with Fixes #9783; I found no duplicate fix in its comments.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5617564146 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#pullrequestreview-5617564146). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T16:30:29Z. **Review:** DISMISSED --- The state decode and output specialization changes are consistent with the intended raw UINT path, and the new decode checks cover unsupported packed exports plus blend suppression. Current-main `check_conventions.py` and `git diff --check` pass. I did not build/run the Vulkan execution test locally. The fork verification workflow for the `fix/agc-uint-color-export` ref is still in progress at the time of this review; I have not counted its results as passing. The upstream PR checks themselves show eligibility/conventions/labels, while full product builds are skipped. Two follow-ups before merge: - This head is eight commits behind live `main` (`8499ea52e571b0edfc1feecfd3f6b9944012b359`). CONTRIBUTING.md requires branches to be based on and kept up to date with `main`; please sync and rerun the checks on the final head. - The execution test bit-checks `32_R` output into `R32_UINT` in tiled and linear layouts. The implementation also accepts `32_GR`, `32_AR` and `32_ABGR`, while the decode unit tests currently check R32 and R8. Please add focused multi-channel execution coverage for those accepted export formats, or narrow the supported-format claim to the formats covered by the evidence. The issue #9783 is open and correctly linked with `Fixes #9783`; I found no duplicate fix in its comments.
MarcZX10 commented 2026-10-22 16:56:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T16:56:29Z.

Review: COMMENTED


The latest head 81d67188b66510d2465ef10ba8dd15743e90b586 fixes the previously reported test compile issues according to the author’s follow-up and macOS workflow link. Current-main conventions and git diff --check pass, and the merge tree is clean. The PR reports valuable MoltenVK/title validation and the upstream hosted product jobs are skipped. This VM has no Vulkan device for the required paired validation-layer run, so those results remain contributor-reported. The branch is still 21 commits behind current main (11f976b27c16ed91633f00039dba5dfd97dd7cc1); please rebase and rerun the execution test and main/change validation comparison on the current base before merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5617855230 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#pullrequestreview-5617855230). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T16:56:29Z. **Review:** COMMENTED --- The latest head `81d67188b66510d2465ef10ba8dd15743e90b586` fixes the previously reported test compile issues according to the author’s follow-up and macOS workflow link. Current-main conventions and `git diff --check` pass, and the merge tree is clean. The PR reports valuable MoltenVK/title validation and the upstream hosted product jobs are skipped. This VM has no Vulkan device for the required paired validation-layer run, so those results remain contributor-reported. The branch is still 21 commits behind current `main` (`11f976b27c16ed91633f00039dba5dfd97dd7cc1`); please rebase and rerun the execution test and main/change validation comparison on the current base before merge.
adriadam10 commented 2026-10-22 19:06:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-22T19:06:07Z.

Review: CHANGES_REQUESTED


The new execution test fails on your own hosted run, and the cause is in the shader, which this PR doesn't touch:

  • Your verify run 39811668668 on 81d67188b6 is green only because its ctest step ends in || true. Its ctest.log artifact has agc_driver_uint_color_target failing: a 32_R export of 0x00000001 into a tiled 32-bit UINT target: pixel (0, 0) inside the scissor holds 0x00000000, expected 0x00000001. The same log also has agc_driver_graphics failing (alternate color blend constants were not swizzled with the export), along with three other agc tests. Please check whether those also fail on the base you ran on.
  • Cause: SelectExportPacking (core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp:427-441) treats any packing other than None as a packed word. With Uint it takes the Format11_11_10UNorm path, writes PackExport(...) into component 0 and zeroes the rest. The specialization then bitcasts that word to uint4, so a UINT target gets the 10_11_11 UNORM packing of the float, not its raw bits. Word 0 survives that and word 1 (a denormal) becomes 0, which matches the failure above. So the Doom 3 BFG pipeline compiles on MoltenVK, but the target doesn't get the values the console's CB stores.
  • Suggested fix: in SelectExportPacking, set packed only for Unorm10_11_11 and Float11_11_10, so that Uint passes the color through and the existing retype does the bitcast. Then make sure agc_driver_uint_color_target passes on a run whose ctest failures fail the job. Please also update the "Tested" section, which currently says the hosted run passes.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5619464664 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#pullrequestreview-5619464664). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-22T19:06:07Z. **Review:** CHANGES_REQUESTED --- The new execution test fails on your own hosted run, and the cause is in the shader, which this PR doesn't touch: - Your verify run [39811668668](https://github.com/rooklz/AnyPS5/actions/runs/39811668668) on `81d67188b6` is green only because its ctest step ends in `|| true`. Its `ctest.log` artifact has `agc_driver_uint_color_target` failing: `a 32_R export of 0x00000001 into a tiled 32-bit UINT target: pixel (0, 0) inside the scissor holds 0x00000000, expected 0x00000001`. The same log also has `agc_driver_graphics` failing (`alternate color blend constants were not swizzled with the export`), along with three other agc tests. Please check whether those also fail on the base you ran on. - Cause: `SelectExportPacking` (`core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp:427-441`) treats any packing other than `None` as a packed word. With `Uint` it takes the `Format11_11_10UNorm` path, writes `PackExport(...)` into component 0 and zeroes the rest. The specialization then bitcasts that word to `uint4`, so a UINT target gets the 10_11_11 UNORM packing of the float, not its raw bits. Word 0 survives that and word 1 (a denormal) becomes 0, which matches the failure above. So the Doom 3 BFG pipeline compiles on MoltenVK, but the target doesn't get the values the console's CB stores. - Suggested fix: in `SelectExportPacking`, set `packed` only for `Unorm10_11_11` and `Float11_11_10`, so that `Uint` passes the color through and the existing retype does the bitcast. Then make sure `agc_driver_uint_color_target` passes on a run whose ctest failures fail the job. Please also update the "Tested" section, which currently says the hosted run passes.
adriadam10 commented 2026-10-22 20:47:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-22T20:47:22Z.

Review: CHANGES_REQUESTED


Thanks for the fix: SelectExportPacking now passes the color through for Uint, and agc_driver_uint_color_target passes on your run of cdfc5fe689. Two things remain:

  • core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp:2025: the CB resolve guard is source.packing != ColorExportPacking::None. Every UINT target now has packing == Uint, so a resolve of a UINT target throws "CB resolves of unsigned integer color targets are unsupported", where on main it was accepted (the format/extent checks above are the only ones it had). Use WordPacked(source.packing) there, as you did for the DCC check at line 1856, and add a case to Graphics.cpp that decodes a resolve with a UINT source and expects it to pass.
  • Your run 39846282162 on cdfc5fe689 still fails agc_driver_graphics (ctest.log has it failing after 0.10 s, with no message). Your earlier comment lists it among the failures from 81d67188b6, but not among those that also fail on main. Please show the failing assertion and whether main fails it too on the same job; if it is the PR (e.g. the static_cast<ColorExportPacking>(4) change in float11_11_10TargetTests or the new uintTargetTests), it needs fixing.

Also please correct the "Tested" section so it states which tests pass and which fail on a run whose ctest failures fail the job.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5620649829 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#pullrequestreview-5620649829). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-22T20:47:22Z. **Review:** CHANGES_REQUESTED --- Thanks for the fix: `SelectExportPacking` now passes the color through for `Uint`, and `agc_driver_uint_color_target` passes on your run of `cdfc5fe689`. Two things remain: - `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp:2025`: the CB resolve guard is `source.packing != ColorExportPacking::None`. Every UINT target now has `packing == Uint`, so a resolve of a UINT target throws "CB resolves of unsigned integer color targets are unsupported", where on main it was accepted (the format/extent checks above are the only ones it had). Use `WordPacked(source.packing)` there, as you did for the DCC check at line 1856, and add a case to `Graphics.cpp` that decodes a resolve with a UINT source and expects it to pass. - Your run 39846282162 on `cdfc5fe689` still fails `agc_driver_graphics` (`ctest.log` has it failing after 0.10 s, with no message). Your earlier comment lists it among the failures from `81d67188b6`, but not among those that also fail on `main`. Please show the failing assertion and whether `main` fails it too on the same job; if it is the PR (e.g. the `static_cast<ColorExportPacking>(4)` change in `float11_11_10TargetTests` or the new `uintTargetTests`), it needs fixing. Also please correct the "Tested" section so it states which tests pass and which fail on a run whose ctest failures fail the job.
adriadam10 commented 2026-10-22 22:19:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-22T22:19:15Z.

Review: CHANGES_REQUESTED


Thanks for the update. The first point from the last review is still open:

  • core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp:2027: the CB resolve guard is still source.packing != ColorExportPacking::None. DecodeColorFormat (line 1748) now gives every UINT target packing == Uint, so a resolve of a UINT target throws "CB resolves of unsigned integer color targets are unsupported", where main accepted it (the format/extent checks above were its only ones). Use WordPacked(source.packing) there, as at line 1858, and add a case next to the resolve checks in Graphics.cpp (around line 3790; the loop there only covers the 10_11_11 and 11_11_10 targets) that decodes a resolve with a UINT source and expects it to pass.

The change to uintTargetTests (zeroing context[0x105..0x108]) is not explained: if it fixes the agc_driver_graphics failure from your fork run, please post the failing assertion it addressed and a run on this head whose ctest failures fail the job, so the "Tested" section can say which tests pass and which fail (and whether main fails them too).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5621561370 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#pullrequestreview-5621561370). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-22T22:19:15Z. **Review:** CHANGES_REQUESTED --- Thanks for the update. The first point from the last review is still open: - `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp:2027`: the CB resolve guard is still `source.packing != ColorExportPacking::None`. `DecodeColorFormat` (line 1748) now gives every UINT target `packing == Uint`, so a resolve of a UINT target throws "CB resolves of unsigned integer color targets are unsupported", where `main` accepted it (the format/extent checks above were its only ones). Use `WordPacked(source.packing)` there, as at line 1858, and add a case next to the resolve checks in `Graphics.cpp` (around line 3790; the loop there only covers the 10_11_11 and 11_11_10 targets) that decodes a resolve with a UINT source and expects it to pass. The change to `uintTargetTests` (zeroing `context[0x105..0x108]`) is not explained: if it fixes the `agc_driver_graphics` failure from your fork run, please post the failing assertion it addressed and a run on this head whose ctest failures fail the job, so the "Tested" section can say which tests pass and which fail (and whether `main` fails them too).
adriadam10 commented 2026-10-22 22:23:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-22T22:23:05Z.

Review: CHANGES_REQUESTED


Thanks for the update. The head only adds words.context[0x1e0] = 0 to the test; the main point is still open:

  • core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp:2027: the CB resolve guard is still source.packing != ColorExportPacking::None. Every UINT target now has packing == Uint, so resolving a UINT target throws "CB resolves of unsigned integer color targets are unsupported", where main accepted it. Use WordPacked(source.packing) there, as at line 1858, and add a case next to the resolve checks in Graphics.cpp (around line 3790, where the loop only covers 10_11_11 and 11_11_10) that decodes a resolve with a UINT source and expects it to pass.
  • uintTargetTests: please say which assertion the context[0x1e0] = 0 line fixes, and show a run on this head so the "Tested" section lists what passes and what fails (and whether main fails the same tests).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5621592763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#pullrequestreview-5621592763). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-22T22:23:05Z. **Review:** CHANGES_REQUESTED --- Thanks for the update. The head only adds `words.context[0x1e0] = 0` to the test; the main point is still open: - `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp:2027`: the CB resolve guard is still `source.packing != ColorExportPacking::None`. Every UINT target now has `packing == Uint`, so resolving a UINT target throws "CB resolves of unsigned integer color targets are unsupported", where `main` accepted it. Use `WordPacked(source.packing)` there, as at line 1858, and add a case next to the resolve checks in `Graphics.cpp` (around line 3790, where the loop only covers 10_11_11 and 11_11_10) that decodes a resolve with a UINT source and expects it to pass. - `uintTargetTests`: please say which assertion the `context[0x1e0] = 0` line fixes, and show a run on this head so the "Tested" section lists what passes and what fails (and whether `main` fails the same tests).
adriadam10 commented 2026-10-24 04:33:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-24T04:33:20Z.

Review: CHANGES_REQUESTED


Re-checked on the current head: the code stands as reviewed (CB resolve guard, UINT-source resolve case, serializer and specialization bounds, debt entry), and valenciana-nc's Windows/NVIDIA run covers the draw path. The merge queue refuses it only because of @MarcZX10's open change request (2026-10-22 16:30), which his later comment does not clear and our approval cannot override. The point still open:

  • core/libs/prx/libSceAgcDriver/tests/execution/UintColorTarget.cpp:225 (TargetTests): the execution test draws only a 32_R export (Word32Export) into tiled and linear R32_UINT. The description and the debt entry say 32_GR, 32_AR and 32_ABGR exports are stored as raw bits too, and the ccleste case is an R8_UINT target; both are covered only by decode assertions. Either add execution cases for those exports (bit-exact read-back of each exported channel, plus a 32-bit export into an R8_UINT target with the expected channel conversion) or narrow the claim in the description and the debt entry to what the test pins.

Once that is pushed, please ping @MarcZX10 for a re-review so the request is cleared; the rest is ready to merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5636845224 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9789#pullrequestreview-5636845224). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-24T04:33:20Z. **Review:** CHANGES_REQUESTED --- Re-checked on the current head: the code stands as reviewed (CB resolve guard, UINT-source resolve case, serializer and specialization bounds, debt entry), and valenciana-nc's Windows/NVIDIA run covers the draw path. The merge queue refuses it only because of @MarcZX10's open change request (2026-10-22 16:30), which his later comment does not clear and our approval cannot override. The point still open: - `core/libs/prx/libSceAgcDriver/tests/execution/UintColorTarget.cpp:225` (`TargetTests`): the execution test draws only a `32_R` export (`Word32Export`) into tiled and linear `R32_UINT`. The description and the debt entry say `32_GR`, `32_AR` and `32_ABGR` exports are stored as raw bits too, and the ccleste case is an `R8_UINT` target; both are covered only by decode assertions. Either add execution cases for those exports (bit-exact read-back of each exported channel, plus a 32-bit export into an `R8_UINT` target with the expected channel conversion) or narrow the claim in the description and the debt entry to what the test pins. Once that is pushed, please ping @MarcZX10 for a re-review so the request is cleared; the rest is ready to merge.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9789
No description provided.