feat(agc): support uniform custom MSAA sample locations #2169

Merged
authurtabo-byte merged 6 commits from upstream-pr/2169 into main 2026-10-12 06:06:45 +00:00
authurtabo-byte commented 2026-10-09 10:36:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by authurtabo-byte on 2026-10-09T10:36:52Z.


What

Depends on #419. Its prerequisite commits are included; the follow-up is feat(agc): support uniform custom MSAA sample locations.

After multisampled targets are supported, 3D MiniGolf (PPSA03647) aborts while loading its first course because its four PA_SC_AA_SAMPLE_LOCS_PIXEL registers contain 0x22eea66a, rather than Vulkan's standard four-sample pattern. Preserve the guest's sample indices and signed sixteenth-pixel offsets through VK_EXT_sample_locations for uniform 2x, 4x and 8x patterns.

Query the device's sample counts, coordinate range, subpixel precision and grid support before enabling the extension. Include the pattern in pipeline and render-pass continuation keys, check the actual depth format and sample count with vkGetPhysicalDeviceImageFormatProperties, create compatible depth images, and supply sample locations at pipeline creation and render-pass begin. Depth attachments retain GENERAL throughout their use. Spatially varying 2x2 patterns and unsupported devices throw. CB resolves validate sample counts independently of raster sample locations.

Vulkan behavior follows the official sample-location pipeline state, render-pass state, and depth-attachment requirement. The guest coordinate interpretation is unchanged from #419; PS5 coverage and interpolation equivalence remain unmeasured and are recorded in TechnicalDebt.

Tested

Rebased onto main c9da0f93. Preserved upstream depth-surface extent/format checks while retaining the prerequisite HTILE fast-clear handling. Windows, MinGW-w64 GCC 15.2.0, Release, NVIDIA GeForce RTX 3050 6GB Laptop GPU.

  • Independent build of this stacked contribution branch: production libSceAgcDriver, agc_driver_graphics_tests, and both depth fast-clear test targets build successfully. All three focused tests pass: agc_driver_graphics (6.25 s), agc_driver_depth_fast_clear (1.23 s), and agc_driver_depth_fast_clear_submit (0.47 s).
  • Fixed a missing closing brace between the existing unsigned-color export tests and sample-location capability test helpers; the rebuilt graphics tests include upstream depth-surface reuse regressions.
  • Regression cases cover custom coordinates and sample indices, signed endpoints for 2x/8x, the normalized standard 4x coordinates, spatially varying pattern refusal, missing extension/count support, unsupported depth formats and depth sample counts, exact image-query flags and usage, and standard-pattern fallback. Unexpected Vulkan query errors propagate. Capability queries run at pipeline creation, rather than on each draw.
  • tools/check_conventions.py --base origin/main passes.
  • Earlier MiniGolf (PPSA03647) integration test: course loading changes from nonstandard sample locations are unsupported to a rendered course and HUD. The separate unwritten-pixel-program blocker is covered by #2022. A completed shot is not confirmed; this PR alone does not provide all title startup fixes.
  • Raghav314 independently tested the previous revision on Linux/RTX 4090 with Hades II (PPSA36082), stacked with #419, #2121 and #2132: custom 0x444cc4cc locations rendered correctly in gameplay. His overlapping #2183 was closed in favor of this PR. The depth-format capability check and standard-coordinate regression above address his feedback.

Linux was not rerun locally. Validation layers and console coverage/interpolation equivalence were not tested. Guest coordinate interpretation remains documented as inferred in TechnicalDebt.

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; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source: none added
  • Generic behaviour, not specific to one title
  • Depends on: #419
  • AI-assisted: yes, Codex
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4799268821 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169). Originally posted by [authurtabo-byte](https://github.com/authurtabo-byte) on 2026-10-09T10:36:52Z. --- ### What Depends on #419. Its prerequisite commits are included; the follow-up is `feat(agc): support uniform custom MSAA sample locations`. After multisampled targets are supported, 3D MiniGolf (PPSA03647) aborts while loading its first course because its four PA_SC_AA_SAMPLE_LOCS_PIXEL registers contain `0x22eea66a`, rather than Vulkan's standard four-sample pattern. Preserve the guest's sample indices and signed sixteenth-pixel offsets through VK_EXT_sample_locations for uniform 2x, 4x and 8x patterns. Query the device's sample counts, coordinate range, subpixel precision and grid support before enabling the extension. Include the pattern in pipeline and render-pass continuation keys, check the actual depth format and sample count with vkGetPhysicalDeviceImageFormatProperties, create compatible depth images, and supply sample locations at pipeline creation and render-pass begin. Depth attachments retain GENERAL throughout their use. Spatially varying 2x2 patterns and unsupported devices throw. CB resolves validate sample counts independently of raster sample locations. Vulkan behavior follows the official [sample-location pipeline state](https://docs.vulkan.org/refpages/latest/refpages/source/VkPipelineSampleLocationsStateCreateInfoEXT.html), [render-pass state](https://docs.vulkan.org/refpages/latest/refpages/source/VkRenderPassSampleLocationsBeginInfoEXT.html), and [depth-attachment requirement](https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdDraw.html). The guest coordinate interpretation is unchanged from #419; PS5 coverage and interpolation equivalence remain unmeasured and are recorded in TechnicalDebt. ### Tested Rebased onto main `c9da0f93`. Preserved upstream depth-surface extent/format checks while retaining the prerequisite HTILE fast-clear handling. Windows, MinGW-w64 GCC 15.2.0, Release, NVIDIA GeForce RTX 3050 6GB Laptop GPU. - Independent build of this stacked contribution branch: production `libSceAgcDriver`, `agc_driver_graphics_tests`, and both depth fast-clear test targets build successfully. All three focused tests pass: `agc_driver_graphics` (6.25 s), `agc_driver_depth_fast_clear` (1.23 s), and `agc_driver_depth_fast_clear_submit` (0.47 s). - Fixed a missing closing brace between the existing unsigned-color export tests and sample-location capability test helpers; the rebuilt graphics tests include upstream depth-surface reuse regressions. - Regression cases cover custom coordinates and sample indices, signed endpoints for 2x/8x, the normalized standard 4x coordinates, spatially varying pattern refusal, missing extension/count support, unsupported depth formats and depth sample counts, exact image-query flags and usage, and standard-pattern fallback. Unexpected Vulkan query errors propagate. Capability queries run at pipeline creation, rather than on each draw. - `tools/check_conventions.py --base origin/main` passes. - Earlier MiniGolf (PPSA03647) integration test: course loading changes from `nonstandard sample locations are unsupported` to a rendered course and HUD. The separate unwritten-pixel-program blocker is covered by #2022. A completed shot is not confirmed; this PR alone does not provide all title startup fixes. - Raghav314 independently tested the previous revision on Linux/RTX 4090 with Hades II (PPSA36082), stacked with #419, #2121 and #2132: custom `0x444cc4cc` locations rendered correctly in gameplay. His overlapping #2183 was closed in favor of this PR. The depth-format capability check and standard-coordinate regression above address his feedback. Linux was not rerun locally. Validation layers and console coverage/interpolation equivalence were not tested. Guest coordinate interpretation remains documented as inferred in TechnicalDebt. ### Checklist - [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 - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source: none added - [x] Generic behaviour, not specific to one title - [x] Depends on: #419 - [x] AI-assisted: yes, Codex
github-actions[bot] commented 2026-10-09 10:48:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T10:48:34Z.


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
#1316 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp L173
#1368 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp L15
#2121 docs/dev/TechnicalDebt.md L559
#3846 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L189
#4106 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp L1153
#4199 docs/dev/TechnicalDebt.md L559
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6079374297 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6079374297). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T10:48:34Z. --- <!-- pr-overlap --> 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 | |---|---|---|---| | #1316 | `core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp` [L173](https://github.com/boykopovar/AnyPS5/blob/b42ef24e07725ba1166420073817d80a60ec9149/core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp#L173) | | | | #1368 | `core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp` [L15](https://github.com/boykopovar/AnyPS5/blob/b42ef24e07725ba1166420073817d80a60ec9149/core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp#L15) | | | | #2121 | `docs/dev/TechnicalDebt.md` [L559](https://github.com/boykopovar/AnyPS5/blob/b42ef24e07725ba1166420073817d80a60ec9149/docs/dev/TechnicalDebt.md#L559) | | | | #3846 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L189](https://github.com/boykopovar/AnyPS5/blob/b42ef24e07725ba1166420073817d80a60ec9149/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L189) | | | | #4106 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` [L1153](https://github.com/boykopovar/AnyPS5/blob/b42ef24e07725ba1166420073817d80a60ec9149/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L1153) | | | | #4199 | `docs/dev/TechnicalDebt.md` [L559](https://github.com/boykopovar/AnyPS5/blob/b42ef24e07725ba1166420073817d80a60ec9149/docs/dev/TechnicalDebt.md#L559) | | |
Raghav314 commented 2026-10-09 11:07:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T11:07:47Z.


Tested this with Hades II (PPSA36082) on Linux / RTX 4090. It needs the same thing with a different pattern: PA_SC_AA_SAMPLE_LOCS is 0x444cc4cc for all four pixels, an ordered (±4, ±4)/16 grid on its 4x targets. With this commit in place of my own version, it renders correctly in gameplay with no refusals in the log. (Stack: #419 plus my #2121 and #2132.)

One thing I ran into doing the same change: vkCreateImage needs SAMPLE_LOCATIONS_COMPATIBLE_DEPTH to be supported for the depth format and sample count, and the extension's sample counts alone don't guarantee that. I checked it with vkGetPhysicalDeviceImageFormatProperties (the flag plus the image's usage) before setting it, and refused a custom-location draw whose depth format the device can't support. Every depth format passes on the 4090, so it doesn't change anything there, but it might matter on other drivers.

If it's useful as a test: the console's standard 4x offsets {-2,-6}, {6,-2}, {-6,2}, {2,6} should come out as Vulkan's standard 4x positions (0.375, 0.125), (0.875, 0.375), (0.125, 0.625), (0.625, 0.875). That checks both the 1/16 scale and the y direction in one go.

I opened #2183 before I saw this one. I'll close it, since this came first and covers more (render-pass begin, devices without variable locations).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6079661140 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6079661140). Originally posted by [Raghav314](https://github.com/Raghav314) on 2026-10-09T11:07:47Z. --- Tested this with Hades II (PPSA36082) on Linux / RTX 4090. It needs the same thing with a different pattern: `PA_SC_AA_SAMPLE_LOCS` is `0x444cc4cc` for all four pixels, an ordered (±4, ±4)/16 grid on its 4x targets. With this commit in place of my own version, it renders correctly in gameplay with no refusals in the log. (Stack: #419 plus my #2121 and #2132.) One thing I ran into doing the same change: `vkCreateImage` needs `SAMPLE_LOCATIONS_COMPATIBLE_DEPTH` to be supported for the depth format and sample count, and the extension's sample counts alone don't guarantee that. I checked it with `vkGetPhysicalDeviceImageFormatProperties` (the flag plus the image's usage) before setting it, and refused a custom-location draw whose depth format the device can't support. Every depth format passes on the 4090, so it doesn't change anything there, but it might matter on other drivers. If it's useful as a test: the console's standard 4x offsets `{-2,-6}, {6,-2}, {-6,2}, {2,6}` should come out as Vulkan's standard 4x positions `(0.375, 0.125), (0.875, 0.375), (0.125, 0.625), (0.625, 0.875)`. That checks both the 1/16 scale and the y direction in one go. I opened #2183 before I saw this one. I'll close it, since this came first and covers more (render-pass begin, devices without variable locations).
JAB-dev commented 2026-10-09 17:45:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-09T17:45:43Z.


Tested this at 04853638 on Seeker: My Shadow (PPSA12500, Unity), Windows 11, RTX 4070 SUPER. It renders into 4x MSAA targets (PA_SC_AA_CONFIG 0x0020c002) with nonstandard sample positions. Without it the title stops at multisampling or coverage conversion is unsupported, with #419 alone at nonstandard sample locations are unsupported, and with this PR it gets past both.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6086181795 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6086181795). Originally posted by [JAB-dev](https://github.com/JAB-dev) on 2026-10-09T17:45:43Z. --- Tested this at 04853638 on Seeker: My Shadow (PPSA12500, Unity), Windows 11, RTX 4070 SUPER. It renders into 4x MSAA targets (`PA_SC_AA_CONFIG` 0x0020c002) with nonstandard sample positions. Without it the title stops at `multisampling or coverage conversion is unsupported`, with #419 alone at `nonstandard sample locations are unsupported`, and with this PR it gets past both.
authurtabo-byte commented 2026-10-09 20:31:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by authurtabo-byte on 2026-10-09T20:31:05Z.


Thanks @Raghav314 and @JAB-dev for testing across Hades II (Linux/NVIDIA) and Seeker: My Shadow (Windows/NVIDIA).

Pushed \d92a665f:

  • Validates \SAMPLE_LOCATIONS_COMPATIBLE_DEPTH\ via \ kGetPhysicalDeviceImageFormatProperties\ before attaching the flag, ensuring incompatible depth formats fall back safely.
  • Added regression coverage in \Graphics.cpp\ for depth format compatibility and verified that standard 4x sample offsets {-2,-6}, {6,-2}, {-6,2}, {2,6}\ map to Vulkan positions (0.375, 0.125), (0.875, 0.375), (0.125, 0.625), (0.625, 0.875).
  • \gc_driver_graphics\ passes cleanly.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088755442 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6088755442). Originally posted by [authurtabo-byte](https://github.com/authurtabo-byte) on 2026-10-09T20:31:05Z. --- Thanks @Raghav314 and @JAB-dev for testing across Hades II (Linux/NVIDIA) and Seeker: My Shadow (Windows/NVIDIA). Pushed \d92a665f\: - Validates \SAMPLE_LOCATIONS_COMPATIBLE_DEPTH\ via \ kGetPhysicalDeviceImageFormatProperties\ before attaching the flag, ensuring incompatible depth formats fall back safely. - Added regression coverage in \Graphics.cpp\ for depth format compatibility and verified that standard 4x sample offsets \{-2,-6}, {6,-2}, {-6,2}, {2,6}\ map to Vulkan positions \(0.375, 0.125), (0.875, 0.375), (0.125, 0.625), (0.625, 0.875)\. - \gc_driver_graphics\ passes cleanly.
oneandonlydean commented 2026-10-11 04:55:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T04:55:48Z.


Thanks for the rebase and for adding the depth-format check and the standard 4x test. Nothing more is needed from you right now.

This is stacked on #419, which conflicts with main and is waiting on #374 and on a direction for multisampled targets. Once #419 is in, rebase this so it only carries its own commit and it goes into testing next. Three titles are waiting on it (PPSA03647, PPSA12500, PPSA36082), so it won't be dropped.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6105615828 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6105615828). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T04:55:48Z. --- Thanks for the rebase and for adding the depth-format check and the standard 4x test. Nothing more is needed from you right now. This is stacked on #419, which conflicts with main and is waiting on #374 and on a direction for multisampled targets. Once #419 is in, rebase this so it only carries its own commit and it goes into testing next. Three titles are waiting on it (PPSA03647, PPSA12500, PPSA36082), so it won't be dropped.
Amoenus commented 2026-10-11 05:12:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T05:12:29Z.


Independent validation: standard 8x sample7 table mismatch

The final entry in StandardLocations8 is (7, -8) in #419 at b75dc179 and #2169 at 55cc2824. Vulkan's standard sample table specifies sample index 7 at (0.9375, 0.0625), which corresponds to (7, -7) under the existing signed sixteenth-pixel conversion. (7, -8) converts to (0.9375, 0.0).

Two captures of PPSA99902's first blocked draw have this uniform pattern in all four pixels:

(1,-3), (-1,3), (5,1), (-3,-5), (-5,5), (-7,-1), (3,7), (7,-7)
PA_SC_AA_SAMPLE_LOCS_PIXEL*_0 = 0xbd153fd1
PA_SC_AA_SAMPLE_LOCS_PIXEL*_1 = 0x9773f95b

I compiled the unchanged extracted decoder blocks from both exact heads, then separately changed only (7, -8) to (7, -7). With AA_CONFIG=0x0030e003 only in the CPU fixture:

  • #419's unchanged decoder throws nonstandard sample locations are unsupported; the one-entry correction returns eight.
  • #2169's unchanged decoder sets customSampleLocations=true; the one-entry correction sets it false. This avoids requiring custom sample-location support for an actually standard 8x pattern.
  • All four original/corrected cases passed five repeats: 20 passes, including independently encoded standard 2x/4x controls and varying-pixel refusals. Reverting the correction while retaining the corrected expectation failed for each PR.

Independent native Vulkan measurement on Windows 11 / RTX 5080 (standardSampleLocations=VK_TRUE), using gl_SamplePosition/gl_SampleID, full sample shading and a fragment SSBO: every 2x/4x/8x position matched Vulkan's table in five repeats (70 samples, 280 component checks, max 0.270 s). Sample7 was (0.9375, 0.0625) every time. All five deliberately wrong expectations with last Y=0 failed. Shaders were compiled with this repository's built glslang and Vulkan headers. No validation-layer run is claimed.

Suggested narrow correction: replace the last StandardLocations8 entry with {7, -7}, plus a regression using the two independent register words above. #2169 should assert that this standard 8x pattern does not require VK_EXT_sample_locations. Its existing standard-coordinate regression covers 4x; custom 8x endpoint checks do not test this standard pattern.

The separate raw captured PA_SC_AA_CONFIG=0x2030e003 still fails both unchanged decoders on bit29, before sample-location validation. The pinned GFX10.3 schema names it COVERED_CENTROID_IS_CENTER; the pinned RADV producer sets it for GFX10.3+. Captured SPI_PS_INPUT_ENA=SPI_PS_INPUT_ADDR=0x2 enables perspective-center input, without centroid inputs. This identifies the source flag; it does not establish complete PS5 centroid/coverage equivalence or justify removing the general refusal. No bit-cleared state was injected into the title.

This title capture is conditional on earlier local startup prerequisites and a separately validated guest-MSAA-depth snapshot subset; scope and results. Related #419 report.

Scope: exact-head extracted CPU decoder checks and independent native host Vulkan sample positions, not a full #2169 build or title run with this correction. No PS5/AMD coverage/interpolation, Linux/lavapipe, presented frame or gameplay validation is claimed. AI-assisted; evidence/reproducers/one-entry patches preserved locally outside the repository; no new PR or push.

Fork code and validation update (2026-10-11)

Proposed correction (fork only): minimal 8x sample-position commit. This is a one-entry change on the pinned #419 head b75dc179; it depends on that pending MSAA implementation. The same (7,-7) correction applies to #2169. Exact extracted decoders and independent sample-position checks were validated; a full unchanged PR/topic branch build is not claimed. Full runtime checks used the adapted integration. AI-assisted: Codex.

Experimental integration has separate covered-centroid and DCC blockers; correcting the sample table alone does not establish title startup.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6105728137 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6105728137). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-11T05:12:29Z. --- ### Independent validation: standard 8x sample7 table mismatch The final entry in `StandardLocations8` is `(7, -8)` in [#419 at b75dc179](https://github.com/MichonGoddijn231849/AnyPS5-fork/blob/b75dc1791f063328716f8326031b7beb8a6b979b/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L283) and [#2169 at 55cc2824](https://github.com/authurtabo-byte/AnyPS5/blob/55cc2824f9fce4f5e1ae1bb0e12c5eb0026e4aeb/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L310). Vulkan's [standard sample table](https://docs.vulkan.org/spec/latest/chapters/primsrast.html#primsrast-multisampling) specifies sample index 7 at `(0.9375, 0.0625)`, which corresponds to `(7, -7)` under the existing signed sixteenth-pixel conversion. `(7, -8)` converts to `(0.9375, 0.0)`. Two captures of PPSA99902's first blocked draw have this uniform pattern in all four pixels: ```text (1,-3), (-1,3), (5,1), (-3,-5), (-5,5), (-7,-1), (3,7), (7,-7) PA_SC_AA_SAMPLE_LOCS_PIXEL*_0 = 0xbd153fd1 PA_SC_AA_SAMPLE_LOCS_PIXEL*_1 = 0x9773f95b ``` I compiled the unchanged extracted decoder blocks from both exact heads, then separately changed only `(7, -8)` to `(7, -7)`. With `AA_CONFIG=0x0030e003` only in the CPU fixture: - #419's unchanged decoder throws `nonstandard sample locations are unsupported`; the one-entry correction returns eight. - #2169's unchanged decoder sets `customSampleLocations=true`; the one-entry correction sets it false. This avoids requiring custom sample-location support for an actually standard 8x pattern. - All four original/corrected cases passed five repeats: **20 passes**, including independently encoded standard 2x/4x controls and varying-pixel refusals. Reverting the correction while retaining the corrected expectation failed for each PR. Independent native Vulkan measurement on Windows 11 / RTX 5080 (`standardSampleLocations=VK_TRUE`), using `gl_SamplePosition`/`gl_SampleID`, full sample shading and a fragment SSBO: every 2x/4x/8x position matched Vulkan's table in five repeats (**70 samples, 280 component checks**, max **0.270 s**). Sample7 was `(0.9375, 0.0625)` every time. All five deliberately wrong expectations with last Y=0 failed. Shaders were compiled with this repository's built glslang and Vulkan headers. No validation-layer run is claimed. Suggested narrow correction: replace the last `StandardLocations8` entry with `{7, -7}`, plus a regression using the two independent register words above. #2169 should assert that this standard 8x pattern does not require `VK_EXT_sample_locations`. Its existing standard-coordinate regression covers 4x; custom 8x endpoint checks do not test this standard pattern. The separate raw captured `PA_SC_AA_CONFIG=0x2030e003` still fails both unchanged decoders on bit29, before sample-location validation. The pinned [GFX10.3 schema](https://github.com/mihawk-99/PS5_Mesa/blob/0b2d6d1a61d9bbf89cf8beb88a696144f67c61f8/src/amd/registers/gfx103.json) names it `COVERED_CENTROID_IS_CENTER`; the pinned [RADV producer](https://github.com/mihawk-99/PS5_Mesa/blob/0b2d6d1a61d9bbf89cf8beb88a696144f67c61f8/src/amd/vulkan/radv_cmd_buffer.c#L13279) sets it for GFX10.3+. Captured `SPI_PS_INPUT_ENA=SPI_PS_INPUT_ADDR=0x2` enables perspective-center input, without centroid inputs. This identifies the source flag; it does not establish complete PS5 centroid/coverage equivalence or justify removing the general refusal. No bit-cleared state was injected into the title. This title capture is conditional on earlier local startup prerequisites and a separately validated guest-MSAA-depth snapshot subset; [scope and results](https://github.com/boykopovar/AnyPS5/issues/3262). Related [#419 report](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6105597729). Scope: exact-head extracted CPU decoder checks and independent native host Vulkan sample positions, not a full #2169 build or title run with this correction. No PS5/AMD coverage/interpolation, Linux/lavapipe, presented frame or gameplay validation is claimed. AI-assisted; evidence/reproducers/one-entry patches preserved locally outside the repository; no new PR or push. ## Fork code and validation update (2026-10-11) **Proposed correction (fork only):** [minimal 8x sample-position commit](https://github.com/Amoenus/AnyPS5/commit/346a321fdaa6ab7429304a4adb35805edbdcbc81). This is a one-entry change on the pinned #419 head `b75dc179`; it depends on that pending MSAA implementation. The same `(7,-7)` correction applies to #2169. Exact extracted decoders and independent sample-position checks were validated; a full unchanged PR/topic branch build is not claimed. Full runtime checks used the adapted integration. AI-assisted: Codex. [Experimental integration](https://github.com/Amoenus/AnyPS5/commit/5b48c3b06a3c23bbf3c740fef7e17fa77b36766e) has separate covered-centroid and DCC blockers; correcting the sample table alone does not establish title startup.
adriadam10 commented 2026-10-11 11:41:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:41:03Z.

Review: CHANGES_REQUESTED


Thanks for the work and for the third-party results. One thing to fix before this can land:

  • libraryKeys (Graphics/src/Pipeline.cpp:140-184): on GPL devices the fragment shader and fragment output libraries are built with rasterizationSamples and, for custom patterns, a VkPipelineSampleLocationsStateCreateInfoEXT (Pipeline.cpp:350-356), but the keys don't include the sample count or state.customSampleLocations / state.sampleLocations. Two draws that differ only in pattern would reuse the same cached library. Append both to keys.fragmentShader and keys.fragmentOutput, and add a test that two states differing only in pattern produce different keys.

As @oneandonlydean said, please rebase so it carries only its own commits once #419 is in. The same GPL key gap applies to the sample count in #419.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5483162704 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#pullrequestreview-5483162704). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T11:41:03Z. **Review:** CHANGES_REQUESTED --- Thanks for the work and for the third-party results. One thing to fix before this can land: - `libraryKeys` (`Graphics/src/Pipeline.cpp:140-184`): on GPL devices the fragment shader and fragment output libraries are built with `rasterizationSamples` and, for custom patterns, a `VkPipelineSampleLocationsStateCreateInfoEXT` (`Pipeline.cpp:350-356`), but the keys don't include the sample count or `state.customSampleLocations` / `state.sampleLocations`. Two draws that differ only in pattern would reuse the same cached library. Append both to `keys.fragmentShader` and `keys.fragmentOutput`, and add a test that two states differing only in pattern produce different keys. As @oneandonlydean said, please rebase so it carries only its own commits once #419 is in. The same GPL key gap applies to the sample count in #419.
santhoshkumar-dev commented 2026-10-11 11:54:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-11T11:54:19Z.


PPSA03706 (My Friend Peppa Pig, Unity): working fine with #419 + #2169

Tested on main 0f863c102 with #419's own commits and this PR's own commits cherry-picked on top (#374 is already on main; d19dcd275 became empty). Branch: test/pr419-pr2169-ppsa03706 at 50daffdfe. Windows 11, AMD Radeon RX 6700 XT, MinGW-w64 GCC 15.2.0, Release.

  • main: stops at the first multisampled draw, register 0x2f8 = 0x0030e003 (standard 8x, the same value Wobbly Life hit in #419).
  • main + #419: 8x is accepted, then nonstandard sample locations are unsupported. All four pixels carry PA_SC_AA_SAMPLE_LOCS = 5bb137d9 1ff5739d, a uniform 8x pattern: (-7,-3) (7,3) (1,-5) (-5,5) (-3,-7) (3,7) (5,-1) (-1,1).
  • main + #419 + #2169: working fine. The intro video plays, save data is created and mounted, and the opening story scenes and the first tutorial render correctly with subtitles at a steady 29.97 fps. No exception during gameplay across two runs (about 3,600 and 2,300 frames). One non-fatal warning remains: storage image access to depth/stencil surface … is not implemented keeps a 1920x1080 depth texture on the snapshot path.

agc_driver_graphics passes on the combined branch. Changes needed on current main beyond conflict resolution:

  • DrawKeyRegisters grows to 49 entries (main's 0x286 range plus 0x2fe).
  • state.samples is appended to the GPL fragmentShader and fragmentOutput library keys, per @adriadam10's note on #419.
  • main's single-sample CMASK checks (pipe-aligned metadata, texels up to 64 bits, CheckRange) are applied to single-sample targets only. The resolve test's fast-clear destination needs that metadata and real CMASK memory to reach the "fast-clear color target" rejection.
Autosave notice Title card
autosave Peppa's House
Story scene Gameplay
story gameplay

tutorial

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108746192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6108746192). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-11T11:54:19Z. --- ### PPSA03706 (My Friend Peppa Pig, Unity): working fine with #419 + #2169 Tested on main `0f863c102` with #419's own commits and this PR's own commits cherry-picked on top (#374 is already on main; `d19dcd275` became empty). Branch: [`test/pr419-pr2169-ppsa03706`](https://github.com/santhoshkumar-dev/AnyPS5/tree/test/pr419-pr2169-ppsa03706) at `50daffdfe`. Windows 11, AMD Radeon RX 6700 XT, MinGW-w64 GCC 15.2.0, Release. - **main:** stops at the first multisampled draw, `register 0x2f8 = 0x0030e003` (standard 8x, the same value Wobbly Life hit in #419). - **main + #419:** 8x is accepted, then `nonstandard sample locations are unsupported`. All four pixels carry `PA_SC_AA_SAMPLE_LOCS` = `5bb137d9 1ff5739d`, a uniform 8x pattern: (-7,-3) (7,3) (1,-5) (-5,5) (-3,-7) (3,7) (5,-1) (-1,1). - **main + #419 + #2169:** working fine. The intro video plays, save data is created and mounted, and the opening story scenes and the first tutorial render correctly with subtitles at a steady 29.97 fps. No exception during gameplay across two runs (about 3,600 and 2,300 frames). One non-fatal warning remains: `storage image access to depth/stencil surface … is not implemented` keeps a 1920x1080 depth texture on the snapshot path. `agc_driver_graphics` passes on the combined branch. Changes needed on current main beyond conflict resolution: - `DrawKeyRegisters` grows to 49 entries (main's `0x286` range plus `0x2fe`). - `state.samples` is appended to the GPL `fragmentShader` and `fragmentOutput` library keys, per @adriadam10's note on #419. - main's single-sample CMASK checks (pipe-aligned metadata, texels up to 64 bits, `CheckRange`) are applied to single-sample targets only. The resolve test's fast-clear destination needs that metadata and real CMASK memory to reach the "fast-clear color target" rejection. | Autosave notice | Title card | |---|---| | ![autosave](https://raw.githubusercontent.com/santhoshkumar-dev/AnyPS5/ce89356a946edd4623608aa9530ea61aa2244e16/ppsa03706-020s.png) | ![Peppa's House](https://raw.githubusercontent.com/santhoshkumar-dev/AnyPS5/ce89356a946edd4623608aa9530ea61aa2244e16/ppsa03706-040s.png) | | **Story scene** | **Gameplay** | | ![story](https://raw.githubusercontent.com/santhoshkumar-dev/AnyPS5/ce89356a946edd4623608aa9530ea61aa2244e16/ppsa03706-060s.png) | ![gameplay](https://raw.githubusercontent.com/santhoshkumar-dev/AnyPS5/ce89356a946edd4623608aa9530ea61aa2244e16/ppsa03706-090s.png) | ![tutorial](https://raw.githubusercontent.com/santhoshkumar-dev/AnyPS5/ce89356a946edd4623608aa9530ea61aa2244e16/ppsa03706-tutorial.png) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cookie42073-cmd commented 2026-10-11 13:56:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cookie42073-cmd on 2026-10-11T13:56:16Z.


Hi, I’m Blazing Cook. Here’s an update on the fix and the Windows testing.

Independent regression evidence for the fragment-library cache-key review, supporting the correction planned in #419.

Tested exact #2169 head 55cc2824f9fce4f5e1ae1bb0e12c5eb0026e4aeb on Windows x64, MinGW-w64 GCC 15.2.0, Release. The optional attached patch includes sample count, custom-location mode and ordered active sample bytes in both fragment keys. Unsupported counts throw before indexing; inactive bytes and unused standard-pattern bytes preserve reuse.

The permanent regression uses the public Pipeline constructor, production key builder and library cache. Twelve transitions check changed fragment handles/counters, unchanged vertex libraries, linked sample counts/coordinates, sample-index order, reuse and cleanup.

  • Before: new regression present, only the eight-line key correction removed: agc_driver_graphics fails in 1.12 s, sample state rebuilt the wrong pipeline library parts (CTest exit 8).
  • After: restoring only that correction, production graphics driver and three focused targets build. Cold sequential tests pass: graphics 5.82 s, depth-fast-clear 0.78 s, depth-fast-clear-submit 0.69 s; 3/3, 7.34 s total, 30 s timeout each.
  • Cache regression uses mocked Vulkan pipeline callbacks with asynchronous pipeline LTO disabled. Separate depth tests use native Vulkan on RTX 4070 SUPER. This verifies cache behavior; native MSAA rendering, memory coherence and title gameplay remain unverified.
  • Current-main conventions checker 8254975e812705d2f03cc3327940cac02f66c30e passes against the pinned dependency. Full current-main CI, Linux/lavapipe, validation layers and asynchronous LTO remain untested.

Our local commit is cc29a95137038b09f71cfd6d9d493cadc5ad3bf1. Building this older head also required the already-upstream one-line depth-test prerequisite ce65ab2, by MichonGoddijn231849, kept separate from this patch. Integrate after #419/#2169 settle and rebase; this is a pinned-head proposal, not a current-main PR. No duplicate MSAA feature PR is being opened.

AI-assisted with Codex, including Astra. Preserves authurtabo-byte's #2169 and MichonGoddijn231849's #419 work.

The exact optional two-file patch is included below. Raw before/after logs and the reproducible checkpoint are preserved locally.

Cache correction and permanent production regression patch
From cc29a95137038b09f71cfd6d9d493cadc5ad3bf1 Mon Sep 17 00:00:00 2001
From: Blazing Cook <[email protected]>
Date: Sun, 11 Oct 2026 07:44:26 -0500
Subject: [PATCH] fix(agc): include sample state in pipeline library keys

Fragment-shader and fragment-output libraries now distinguish sample count, custom-location mode and ordered active sample locations. Ignore inactive location bytes and unused standard-pattern bytes. Reject unsupported counts before reading the sample array.

Add a regression through the public Pipeline constructor and real pipeline-library cache. Check changed fragment parts, unchanged vertex parts, linked handles, actual sample locations, reuse and cleanup.

Contribution by Blazing Cook. AI-assisted: Codex, including Astra. Addresses the cache-key review on PR #2169; depends on pending #419 and #2169. This local proposal is based on pinned #2169 head55cc2824 and still requires integration after those dependencies are rebased.
---
 .../libSceAgcDriver/Graphics/src/Pipeline.cpp |   8 ++
 .../prx/libSceAgcDriver/tests/Graphics.cpp    | 130 +++++++++++++++++-
 2 files changed, 137 insertions(+), 1 deletion(-)

diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
index 99c71f06..2d53fba5 100644
--- a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
+++ b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
@@ -169,6 +169,14 @@ bool libraryKeys(PipelineLibraryKeys& keys, const Context& context, const State&
     appendKey(keys.preRasterization, state.depth.has_value() && state.depthBias);
     appendKey(keys.preRasterization, state.stages.tessellation.has_value());
     if (state.stages.tessellation) appendKey(keys.preRasterization, state.stages.tessellation->inputControlPoints);
+    Require(state.samples == 1 || state.samples == 2 || state.samples == 4 || state.samples == 8, "invalid sample count for pipeline library key");
+    for (auto* key : {&keys.fragmentShader, &keys.fragmentOutput}) {
+        appendKey(*key, state.samples);
+        appendKey(*key, state.customSampleLocations);
+        if (state.customSampleLocations) {
+            for (std::uint32_t sample = 0; sample < state.samples; ++sample) appendKey(*key, state.sampleLocations[sample]);
+        }
+    }
     for (const auto& blend : state.blends) appendKey(keys.fragmentOutput, blend);
     for (const auto value : state.blendConstants) appendKey(keys.fragmentOutput, value);
     appendKey(keys.renderPass, state.blends.size());
diff --git a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
index 3860c20d..7d74bef2 100644
--- a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
+++ b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
@@ -1769,6 +1769,12 @@ struct MockDescriptorWrite {
     std::vector<VkDescriptorBufferInfo> buffers;
 };
 
+struct MockPipelineLibrary {
+    VkGraphicsPipelineLibraryFlagsEXT part = 0;
+    VkSampleCountFlagBits samples{};
+    std::vector<VkSampleLocationEXT> locations;
+};
+
 struct MockVulkan {
     std::uint64_t next = 1;
     std::int64_t live = 0;
@@ -1797,6 +1803,8 @@ struct MockVulkan {
     VkPipelineBindPoint boundPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM;
     std::map<VkPipelineLayout, VkDeviceSize> pipelineLayoutPushConstantSize;
     std::uint32_t pipelineCreateCount = 0;
+    std::map<VkPipeline, MockPipelineLibrary> pipelineLibraries;
+    std::vector<std::array<VkPipeline, 4>> pipelineLinks;
     std::vector<std::array<std::uint32_t, 3>> pipelineSpecializations;
     VkPipeline boundPipeline = VK_NULL_HANDLE;
     std::vector<std::byte> lastPushConstants;
@@ -1976,7 +1984,38 @@ VKAPI_ATTR VkResult VKAPI_CALL mockCreateComputePipelines(VkDevice, VkPipelineCa
     return VK_SUCCESS;
 }
 
-VKAPI_ATTR void VKAPI_CALL mockDestroyPipeline(VkDevice, VkPipeline, const VkAllocationCallbacks*) {
+VKAPI_ATTR VkResult VKAPI_CALL mockCreateGraphicsPipelines(VkDevice, VkPipelineCache, std::uint32_t count, const VkGraphicsPipelineCreateInfo* infos, const VkAllocationCallbacks*, VkPipeline* pipelines) {
+    Require(count == 1 && infos->pNext != nullptr, "mock expects one graphics pipeline library or link");
+    *pipelines = makeHandle<VkPipeline>();
+    if ((infos->flags & VK_PIPELINE_CREATE_LIBRARY_BIT_KHR) != 0) {
+        const auto* library = static_cast<const VkGraphicsPipelineLibraryCreateInfoEXT*>(infos->pNext);
+        Require(library->sType == VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT, "graphics library flags are missing");
+        MockPipelineLibrary result;
+        result.part = library->flags;
+        if (infos->pMultisampleState != nullptr) {
+            result.samples = infos->pMultisampleState->rasterizationSamples;
+            if (const auto* locations = static_cast<const VkPipelineSampleLocationsStateCreateInfoEXT*>(infos->pMultisampleState->pNext)) {
+                Require(locations->sType == VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT && locations->sampleLocationsEnable, "graphics sample locations are disabled");
+                const auto& sampleInfo = locations->sampleLocationsInfo;
+                Require(sampleInfo.sampleLocationsPerPixel == result.samples && sampleInfo.sampleLocationsCount == result.samples, "graphics sample location count differs from rasterization samples");
+                result.locations.assign(sampleInfo.pSampleLocations, sampleInfo.pSampleLocations + sampleInfo.sampleLocationsCount);
+            }
+        }
+        mock.pipelineLibraries.emplace(*pipelines, std::move(result));
+    } else {
+        const auto* linked = static_cast<const VkPipelineLibraryCreateInfoKHR*>(infos->pNext);
+        Require(infos->flags == 0 && linked->sType == VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR && linked->libraryCount == 4, "graphics pipeline did not link four cached parts");
+        std::array<VkPipeline, 4> libraries{};
+        std::copy_n(linked->pLibraries, libraries.size(), libraries.begin());
+        mock.pipelineLinks.push_back(libraries);
+    }
+    ++mock.pipelineCreateCount;
+    ++mock.live;
+    return VK_SUCCESS;
+}
+
+VKAPI_ATTR void VKAPI_CALL mockDestroyPipeline(VkDevice, VkPipeline pipeline, const VkAllocationCallbacks*) {
+    mock.pipelineLibraries.erase(pipeline);
     --mock.live;
 }
 
@@ -2061,6 +2100,7 @@ PFN_vkVoidFunction VKAPI_CALL mockProc(VkDevice, const char* name) {
         {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(mockCreateShaderModule)},
         {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(mockDestroyShaderModule)},
         {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(mockCreateComputePipelines)},
+        {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(mockCreateGraphicsPipelines)},
         {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(mockDestroyPipeline)},
         {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(mockCmdBindPipeline)},
         {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(mockCmdPushConstants)},
@@ -2808,6 +2848,91 @@ std::vector<std::uint32_t> makeModule(const ModuleShape& shape) {
     return words;
 }
 
+void pipelineLibrarySampleTests() {
+    using namespace AgcDriver::Graphics;
+    mock = MockVulkan{};
+    auto context = mockContext();
+    context.device = makeHandle<VkDevice>();
+    context.graphicsPipelineLibrary = true;
+    context.sampleLocationSampleCounts = VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT | VK_SAMPLE_COUNT_8_BIT;
+    context.limits.framebufferNoAttachmentsSampleCounts = context.sampleLocationSampleCounts;
+    context.limits.maxPushConstantsSize = PipelinePushConstantBytes;
+    {
+        ShaderRecompiler::RecompileResult vertex, fragment;
+        vertex.spirv = makeModule({});
+        fragment.spirv = makeModule({.fragment = true});
+        vertex.variantId = 1;
+        fragment.variantId = 2;
+        const std::array<CompiledShader, 2> shaders{{{ShaderRecompiler::ShaderStage::Vertex, &vertex, 0}, {ShaderRecompiler::ShaderStage::Fragment, &fragment, PipelinePushSlotBytes}}};
+        State state{};
+        state.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+        const ShaderResources resources(context, shaders, state.color, 0, 0, 0);
+        const auto build = [&](const State& samples, const std::array<std::uint64_t, 4>& expected) {
+            const auto links = mock.pipelineLinks.size();
+            { Pipeline pipeline(context, samples, {}, resources, shaders); }
+            const auto counters = PipelineLibraryCountersOf(context.device);
+            Require(mock.pipelineLinks.size() == links + 1 && counters.linked == links + 1 && counters.optimized == 0, "the sample-state test did not link through the pipeline library cache");
+            Require(counters.built == expected, "sample state rebuilt the wrong pipeline library parts");
+            const auto libraries = mock.pipelineLinks.back();
+            const auto locations = SampleLocations(samples);
+            constexpr std::array<VkGraphicsPipelineLibraryFlagsEXT, 4> parts{
+                VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT,
+                VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
+                VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT,
+                VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
+            };
+            for (std::size_t part = 0; part < libraries.size(); ++part) {
+                const auto& library = mock.pipelineLibraries.at(libraries[part]);
+                Require(library.part == parts[part], "sample-state pipeline linked the wrong library part");
+                if (part < 2) continue;
+                Require(library.samples == samples.samples && library.locations.size() == samples.samples, "a fragment library reused another sample count");
+                for (std::size_t sample = 0; sample < library.locations.size(); ++sample) Require(library.locations[sample].x == locations[sample].x && library.locations[sample].y == locations[sample].y, "a fragment library reused another sample pattern or sample index");
+            }
+            return libraries;
+        };
+        const auto compare = [&](const State& first, const State& second, bool changed) {
+            ClearPipelineLibraries(context.device);
+            mock.pipelineLinks.clear();
+            const auto before = build(first, {1, 1, 1, 1});
+            const std::array<std::uint64_t, 4> expected{1, 1, changed ? 2u : 1u, changed ? 2u : 1u};
+            const auto after = build(second, expected);
+            Require(before[0] == after[0] && before[1] == after[1], "sample state rebuilt vertex-input or pre-rasterization libraries");
+            Require((before[2] != after[2]) == changed && (before[3] != after[3]) == changed, "fragment library handles did not follow sample state");
+            Require(build(second, expected) == after, "repeating sample state did not reuse every library");
+        };
+        for (const auto count : {2u, 4u, 8u}) {
+            auto next = state;
+            next.samples = count;
+            compare(state, next, true);
+            state = next;
+        }
+        state.samples = 2;
+        state.sampleLocations = {0x4c, 0xc4};
+        auto custom = state;
+        custom.customSampleLocations = true;
+        compare(state, custom, true);
+        auto reordered = custom;
+        std::swap(reordered.sampleLocations[0], reordered.sampleLocations[1]);
+        compare(custom, reordered, true);
+        auto inactive = custom;
+        inactive.sampleLocations[2] = 0xff;
+        inactive.sampleLocations[7] = 0xff;
+        compare(custom, inactive, false);
+        auto ignored = state;
+        ignored.sampleLocations.fill(0xff);
+        compare(state, ignored, false);
+        compare(custom, custom, false);
+        for (const auto count : {1u, 2u, 4u, 8u}) {
+            custom.samples = count;
+            auto pattern = custom;
+            pattern.sampleLocations[count - 1] ^= 1;
+            compare(custom, pattern, true);
+        }
+        ClearPipelineLibraries(context.device);
+    }
+    Require(mock.live == 0 && mock.pipelineLibraries.empty(), "pipeline library sample tests leaked Vulkan objects");
+}
+
 void barycentricEmulationTests() {
     using namespace ShaderRecompiler;
     using namespace AgcDriver::Graphics;
@@ -4191,9 +4316,11 @@ void parallelCompareTests() {
 
 int main() {
 #ifdef _WIN32
+    _putenv_s("APS5_NO_PIPELINE_LTO", "1");
     _putenv_s("APS5_PIN_WAIT_MS", "200");
     _putenv_s("APS5_HEAP_MIRROR_MIB", "4");
 #else
+    setenv("APS5_NO_PIPELINE_LTO", "1", 1);
     setenv("APS5_PIN_WAIT_MS", "200", 1);
     setenv("APS5_HEAP_MIRROR_MIB", "4", 1);
 #endif
@@ -4265,6 +4392,7 @@ multisampleTests();
         InitialContextTests();
         pushConstantTests();
         resourceTests();
+        pipelineLibrarySampleTests();
         descriptorSnapshotTests();
         descriptorCacheTests();
         misalignedShaderDataTests();
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109769231 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6109769231). Originally posted by [cookie42073-cmd](https://github.com/cookie42073-cmd) on 2026-10-11T13:56:16Z. --- Hi, I’m Blazing Cook. Here’s an update on the fix and the Windows testing. Independent regression evidence for the fragment-library cache-key review, supporting the correction planned in #419. Tested exact #2169 head `55cc2824f9fce4f5e1ae1bb0e12c5eb0026e4aeb` on Windows x64, MinGW-w64 GCC 15.2.0, Release. The optional attached patch includes sample count, custom-location mode and ordered active sample bytes in **both** fragment keys. Unsupported counts throw before indexing; inactive bytes and unused standard-pattern bytes preserve reuse. The permanent regression uses the public `Pipeline` constructor, production key builder and library cache. Twelve transitions check changed fragment handles/counters, unchanged vertex libraries, linked sample counts/coordinates, sample-index order, reuse and cleanup. - **Before:** new regression present, only the eight-line key correction removed: `agc_driver_graphics` fails in **1.12 s**, `sample state rebuilt the wrong pipeline library parts` (CTest exit 8). - **After:** restoring only that correction, production graphics driver and three focused targets build. Cold sequential tests pass: graphics **5.82 s**, depth-fast-clear **0.78 s**, depth-fast-clear-submit **0.69 s**; **3/3, 7.34 s total**, 30 s timeout each. - Cache regression uses mocked Vulkan pipeline callbacks with asynchronous pipeline LTO disabled. Separate depth tests use native Vulkan on RTX 4070 SUPER. This verifies cache behavior; native MSAA rendering, memory coherence and title gameplay remain unverified. - Current-main conventions checker `8254975e812705d2f03cc3327940cac02f66c30e` passes against the pinned dependency. Full current-main CI, Linux/lavapipe, validation layers and asynchronous LTO remain untested. Our local commit is `cc29a95137038b09f71cfd6d9d493cadc5ad3bf1`. Building this older head also required the already-upstream one-line depth-test prerequisite [ce65ab2](https://github.com/boykopovar/AnyPS5/commit/ce65ab251cd3f149f1535f7c0ba1b6952c8f85c8), by MichonGoddijn231849, kept separate from this patch. Integrate after #419/#2169 settle and rebase; this is a pinned-head proposal, not a current-main PR. No duplicate MSAA feature PR is being opened. AI-assisted with **Codex, including Astra**. Preserves authurtabo-byte's #2169 and MichonGoddijn231849's #419 work. The exact optional two-file patch is included below. Raw before/after logs and the reproducible checkpoint are preserved locally. <details> <summary>Cache correction and permanent production regression patch</summary> ```diff From cc29a95137038b09f71cfd6d9d493cadc5ad3bf1 Mon Sep 17 00:00:00 2001 From: Blazing Cook <324818824+[email protected]> Date: Sun, 11 Oct 2026 07:44:26 -0500 Subject: [PATCH] fix(agc): include sample state in pipeline library keys Fragment-shader and fragment-output libraries now distinguish sample count, custom-location mode and ordered active sample locations. Ignore inactive location bytes and unused standard-pattern bytes. Reject unsupported counts before reading the sample array. Add a regression through the public Pipeline constructor and real pipeline-library cache. Check changed fragment parts, unchanged vertex parts, linked handles, actual sample locations, reuse and cleanup. Contribution by Blazing Cook. AI-assisted: Codex, including Astra. Addresses the cache-key review on PR #2169; depends on pending #419 and #2169. This local proposal is based on pinned #2169 head55cc2824 and still requires integration after those dependencies are rebased. --- .../libSceAgcDriver/Graphics/src/Pipeline.cpp | 8 ++ .../prx/libSceAgcDriver/tests/Graphics.cpp | 130 +++++++++++++++++- 2 files changed, 137 insertions(+), 1 deletion(-) diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp index 99c71f06..2d53fba5 100644 --- a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp @@ -169,6 +169,14 @@ bool libraryKeys(PipelineLibraryKeys& keys, const Context& context, const State& appendKey(keys.preRasterization, state.depth.has_value() && state.depthBias); appendKey(keys.preRasterization, state.stages.tessellation.has_value()); if (state.stages.tessellation) appendKey(keys.preRasterization, state.stages.tessellation->inputControlPoints); + Require(state.samples == 1 || state.samples == 2 || state.samples == 4 || state.samples == 8, "invalid sample count for pipeline library key"); + for (auto* key : {&keys.fragmentShader, &keys.fragmentOutput}) { + appendKey(*key, state.samples); + appendKey(*key, state.customSampleLocations); + if (state.customSampleLocations) { + for (std::uint32_t sample = 0; sample < state.samples; ++sample) appendKey(*key, state.sampleLocations[sample]); + } + } for (const auto& blend : state.blends) appendKey(keys.fragmentOutput, blend); for (const auto value : state.blendConstants) appendKey(keys.fragmentOutput, value); appendKey(keys.renderPass, state.blends.size()); diff --git a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp index 3860c20d..7d74bef2 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp @@ -1769,6 +1769,12 @@ struct MockDescriptorWrite { std::vector<VkDescriptorBufferInfo> buffers; }; +struct MockPipelineLibrary { + VkGraphicsPipelineLibraryFlagsEXT part = 0; + VkSampleCountFlagBits samples{}; + std::vector<VkSampleLocationEXT> locations; +}; + struct MockVulkan { std::uint64_t next = 1; std::int64_t live = 0; @@ -1797,6 +1803,8 @@ struct MockVulkan { VkPipelineBindPoint boundPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM; std::map<VkPipelineLayout, VkDeviceSize> pipelineLayoutPushConstantSize; std::uint32_t pipelineCreateCount = 0; + std::map<VkPipeline, MockPipelineLibrary> pipelineLibraries; + std::vector<std::array<VkPipeline, 4>> pipelineLinks; std::vector<std::array<std::uint32_t, 3>> pipelineSpecializations; VkPipeline boundPipeline = VK_NULL_HANDLE; std::vector<std::byte> lastPushConstants; @@ -1976,7 +1984,38 @@ VKAPI_ATTR VkResult VKAPI_CALL mockCreateComputePipelines(VkDevice, VkPipelineCa return VK_SUCCESS; } -VKAPI_ATTR void VKAPI_CALL mockDestroyPipeline(VkDevice, VkPipeline, const VkAllocationCallbacks*) { +VKAPI_ATTR VkResult VKAPI_CALL mockCreateGraphicsPipelines(VkDevice, VkPipelineCache, std::uint32_t count, const VkGraphicsPipelineCreateInfo* infos, const VkAllocationCallbacks*, VkPipeline* pipelines) { + Require(count == 1 && infos->pNext != nullptr, "mock expects one graphics pipeline library or link"); + *pipelines = makeHandle<VkPipeline>(); + if ((infos->flags & VK_PIPELINE_CREATE_LIBRARY_BIT_KHR) != 0) { + const auto* library = static_cast<const VkGraphicsPipelineLibraryCreateInfoEXT*>(infos->pNext); + Require(library->sType == VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT, "graphics library flags are missing"); + MockPipelineLibrary result; + result.part = library->flags; + if (infos->pMultisampleState != nullptr) { + result.samples = infos->pMultisampleState->rasterizationSamples; + if (const auto* locations = static_cast<const VkPipelineSampleLocationsStateCreateInfoEXT*>(infos->pMultisampleState->pNext)) { + Require(locations->sType == VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT && locations->sampleLocationsEnable, "graphics sample locations are disabled"); + const auto& sampleInfo = locations->sampleLocationsInfo; + Require(sampleInfo.sampleLocationsPerPixel == result.samples && sampleInfo.sampleLocationsCount == result.samples, "graphics sample location count differs from rasterization samples"); + result.locations.assign(sampleInfo.pSampleLocations, sampleInfo.pSampleLocations + sampleInfo.sampleLocationsCount); + } + } + mock.pipelineLibraries.emplace(*pipelines, std::move(result)); + } else { + const auto* linked = static_cast<const VkPipelineLibraryCreateInfoKHR*>(infos->pNext); + Require(infos->flags == 0 && linked->sType == VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR && linked->libraryCount == 4, "graphics pipeline did not link four cached parts"); + std::array<VkPipeline, 4> libraries{}; + std::copy_n(linked->pLibraries, libraries.size(), libraries.begin()); + mock.pipelineLinks.push_back(libraries); + } + ++mock.pipelineCreateCount; + ++mock.live; + return VK_SUCCESS; +} + +VKAPI_ATTR void VKAPI_CALL mockDestroyPipeline(VkDevice, VkPipeline pipeline, const VkAllocationCallbacks*) { + mock.pipelineLibraries.erase(pipeline); --mock.live; } @@ -2061,6 +2100,7 @@ PFN_vkVoidFunction VKAPI_CALL mockProc(VkDevice, const char* name) { {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(mockCreateShaderModule)}, {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(mockDestroyShaderModule)}, {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(mockCreateComputePipelines)}, + {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(mockCreateGraphicsPipelines)}, {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(mockDestroyPipeline)}, {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(mockCmdBindPipeline)}, {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(mockCmdPushConstants)}, @@ -2808,6 +2848,91 @@ std::vector<std::uint32_t> makeModule(const ModuleShape& shape) { return words; } +void pipelineLibrarySampleTests() { + using namespace AgcDriver::Graphics; + mock = MockVulkan{}; + auto context = mockContext(); + context.device = makeHandle<VkDevice>(); + context.graphicsPipelineLibrary = true; + context.sampleLocationSampleCounts = VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT | VK_SAMPLE_COUNT_8_BIT; + context.limits.framebufferNoAttachmentsSampleCounts = context.sampleLocationSampleCounts; + context.limits.maxPushConstantsSize = PipelinePushConstantBytes; + { + ShaderRecompiler::RecompileResult vertex, fragment; + vertex.spirv = makeModule({}); + fragment.spirv = makeModule({.fragment = true}); + vertex.variantId = 1; + fragment.variantId = 2; + const std::array<CompiledShader, 2> shaders{{{ShaderRecompiler::ShaderStage::Vertex, &vertex, 0}, {ShaderRecompiler::ShaderStage::Fragment, &fragment, PipelinePushSlotBytes}}}; + State state{}; + state.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + const ShaderResources resources(context, shaders, state.color, 0, 0, 0); + const auto build = [&](const State& samples, const std::array<std::uint64_t, 4>& expected) { + const auto links = mock.pipelineLinks.size(); + { Pipeline pipeline(context, samples, {}, resources, shaders); } + const auto counters = PipelineLibraryCountersOf(context.device); + Require(mock.pipelineLinks.size() == links + 1 && counters.linked == links + 1 && counters.optimized == 0, "the sample-state test did not link through the pipeline library cache"); + Require(counters.built == expected, "sample state rebuilt the wrong pipeline library parts"); + const auto libraries = mock.pipelineLinks.back(); + const auto locations = SampleLocations(samples); + constexpr std::array<VkGraphicsPipelineLibraryFlagsEXT, 4> parts{ + VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT, + VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT, + VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, + VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT, + }; + for (std::size_t part = 0; part < libraries.size(); ++part) { + const auto& library = mock.pipelineLibraries.at(libraries[part]); + Require(library.part == parts[part], "sample-state pipeline linked the wrong library part"); + if (part < 2) continue; + Require(library.samples == samples.samples && library.locations.size() == samples.samples, "a fragment library reused another sample count"); + for (std::size_t sample = 0; sample < library.locations.size(); ++sample) Require(library.locations[sample].x == locations[sample].x && library.locations[sample].y == locations[sample].y, "a fragment library reused another sample pattern or sample index"); + } + return libraries; + }; + const auto compare = [&](const State& first, const State& second, bool changed) { + ClearPipelineLibraries(context.device); + mock.pipelineLinks.clear(); + const auto before = build(first, {1, 1, 1, 1}); + const std::array<std::uint64_t, 4> expected{1, 1, changed ? 2u : 1u, changed ? 2u : 1u}; + const auto after = build(second, expected); + Require(before[0] == after[0] && before[1] == after[1], "sample state rebuilt vertex-input or pre-rasterization libraries"); + Require((before[2] != after[2]) == changed && (before[3] != after[3]) == changed, "fragment library handles did not follow sample state"); + Require(build(second, expected) == after, "repeating sample state did not reuse every library"); + }; + for (const auto count : {2u, 4u, 8u}) { + auto next = state; + next.samples = count; + compare(state, next, true); + state = next; + } + state.samples = 2; + state.sampleLocations = {0x4c, 0xc4}; + auto custom = state; + custom.customSampleLocations = true; + compare(state, custom, true); + auto reordered = custom; + std::swap(reordered.sampleLocations[0], reordered.sampleLocations[1]); + compare(custom, reordered, true); + auto inactive = custom; + inactive.sampleLocations[2] = 0xff; + inactive.sampleLocations[7] = 0xff; + compare(custom, inactive, false); + auto ignored = state; + ignored.sampleLocations.fill(0xff); + compare(state, ignored, false); + compare(custom, custom, false); + for (const auto count : {1u, 2u, 4u, 8u}) { + custom.samples = count; + auto pattern = custom; + pattern.sampleLocations[count - 1] ^= 1; + compare(custom, pattern, true); + } + ClearPipelineLibraries(context.device); + } + Require(mock.live == 0 && mock.pipelineLibraries.empty(), "pipeline library sample tests leaked Vulkan objects"); +} + void barycentricEmulationTests() { using namespace ShaderRecompiler; using namespace AgcDriver::Graphics; @@ -4191,9 +4316,11 @@ void parallelCompareTests() { int main() { #ifdef _WIN32 + _putenv_s("APS5_NO_PIPELINE_LTO", "1"); _putenv_s("APS5_PIN_WAIT_MS", "200"); _putenv_s("APS5_HEAP_MIRROR_MIB", "4"); #else + setenv("APS5_NO_PIPELINE_LTO", "1", 1); setenv("APS5_PIN_WAIT_MS", "200", 1); setenv("APS5_HEAP_MIRROR_MIB", "4", 1); #endif @@ -4265,6 +4392,7 @@ multisampleTests(); InitialContextTests(); pushConstantTests(); resourceTests(); + pipelineLibrarySampleTests(); descriptorSnapshotTests(); descriptorCacheTests(); misalignedShaderDataTests(); ``` </details>
cookie42073-cmd commented 2026-10-11 17:38:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cookie42073-cmd on 2026-10-11T17:38:46Z.


Hi, I’m Blazing Cook. Here’s an update on the fix and the Windows testing.

Updated verification on PR #2169 head 589d42b7cc7d76193be93999d3d41eae5a0b0d32. This replaces the older 505aa13e/27c69c12 test evidence and patch in this comment.

The current keys include the sample count and custom pattern, but still omit the resolved sampleLocationsEnabled value. On a fixed-capability device, changing to an incompatible depth format can disable standard sample locations while the fragment-shader library still reuses its previous enabled state. The linked multisample definitions then disagree (Vulkan VUID 06635).

The correction passes the already resolved boolean into the private key builder and appends it to both fragment keys. It preserves this head's full-array custom-pattern keys and adds no capability query.

Windows results: MinGW-w64 GCC 15.2.0, Release, bundled dependencies, SPIRV-Tools off (the project default). The full default build passed. With identical regression bytes throughout:

Variant Result
Original 589d42b7 key Expected failure: linked fragment libraries disagree on sample-location enablement; test 0.81 s
Deliberately incorrect depth-presence key Same expected failure; test 0.74 s
Resolved-enable key Graphics 6.34 s, depth-fast-clear 0.63 s, depth-fast-clear-submit 0.72 s; 3/3 passed, 7.75 s total

Five existing pipeline tests also passed in 1.86 s total: cache, normal GPL reuse, GPL-disabled fallback, fast-only GPL reuse, and the link-optimization policy unit test. These are four real-Vulkan invocations plus one policy test; the disabled-GPL run correctly used whole pipelines. No CTest skips occurred. Shader caches were disabled and each test retained its 30 s cap.

The permanent regression uses the production Pipeline constructor and library cache with mocked Vulkan creation callbacks. It covers 11 sample/pattern comparisons and 10 four-build enablement transitions: unsupported-format and supported-format/missing-4x outcomes, both directions, repeats and return reuse, incompatible/compatible formats with depth present on both sides, and no-depth/compatible-depth preserving fragment-shader reuse. Vertex parts remain reused. The native tests are additional coverage; they do not exercise this exact mocked depth-enable matrix or prove background LTO.

Local review-support commit: d8445c6460ded28000b3abc49586ee3d4a0737cf, directly on the pinned PR head. The two-file patch below includes the required mock support; it does not depend on our old local integration. The current-main conventions checker passed for this topic delta. Both project chats independently reviewed the patch and test evidence. A self-contained source checkpoint restored all 2,057 source blobs and passed strict Git integrity checks; raw logs are preserved locally.

This verifies the cache correction on the pinned PR head. It is not a merge with current main, full CI, Linux validation, native reproduction of the depth-enable matrix, or a demonstrated title fix. No duplicate MSAA feature PR is being opened.

Community testing request: Could someone check this transition with native GPL on another GPU/driver, or link an existing small test that reaches it? Please include the exact commit and dependency/patch stack, GPU/driver, OS, settings, and paired startup-to-first-failure logs using the same reproduction steps.

For the separate MSAA memory problem in #419, we still need the intervening writer and completion history. Useful evidence would be:

  • The exact prerequisite RUDP-export commits and full title/homebrew version for the reported stack.
  • A sanitized capture showing target creation, allocations/remaps and aliases, CPU/DMA/GPU writes, completion points, and the first rejected read. Address overlap alone does not identify the last writer or prove a complete overwrite.
  • A small redistributable homebrew/source test that initializes distinct samples, overwrites only part of the image, then reads/copies/resolves it and checks that untouched samples survive. A depth/stencil initialization case would help too.

Links to existing logs or issues are welcome. Testers can run their own local game copies and share observations; please share logs or redistributable repros rather than commercial game files, firmware or keys. The diagnostic prototype is still local and is not being offered as a verified title build.

AI-assisted with Codex, including Astra, with coordinated review across both project chats. Original #2169 and #419 authorship remains with authurtabo-byte and MichonGoddijn231849.

Resolved-enablement correction and permanent regression, directly against 589d42b7
From d8445c6460ded28000b3abc49586ee3d4a0737cf Mon Sep 17 00:00:00 2001
From: Blazing Cook <[email protected]>
Date: Sun, 11 Oct 2026 16:02:00 -0500
Subject: [PATCH] fix(agc): key resolved sample-location enablement

Pass the already resolved sampleLocationsEnabled value to the private
library key builder and include it in both fragment-library keys. Depth
format support can disable standard sample locations on a fixed device;
reusing an enabled fragment shader library then links inconsistent state.

Add production Pipeline/cache regression coverage with immutable mocked
capabilities. Preserve upstream full-array sample keys. Cover eleven
sample/pattern comparisons and ten four-build enablement transitions,
including compatible-depth shader reuse and both unsupported query forms.

Windows MinGW GCC 15.2.0 Release: full default build passes. Identical
regression bytes fail on the original key and a depth-presence proxy;
the correction passes three focused tests in 7.75 seconds. Five existing
pipeline tests pass in 1.86 seconds, including native GPL reuse, disabled
GPL fallback and fast-only mode. The new enablement matrix is mocked;
no native depth-transition, Linux CI or title compatibility is claimed.

Contribution: Blazing Cook. AI-assisted: Codex, including Astra and an
independent review in the other project chat. Based directly on PR #2169
at 589d42b7. Original #2169 and #419 authorship stays with authurtabo-byte
and MichonGoddijn231849. This is review support for the existing PR.
---
 .../libSceAgcDriver/Graphics/src/Pipeline.cpp |   6 +-
 .../prx/libSceAgcDriver/tests/Graphics.cpp    | 170 +++++++++++++++++-
 2 files changed, 173 insertions(+), 3 deletions(-)

diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
index ce5d021..df4462e 100644
--- a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
+++ b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
@@ -163,7 +163,7 @@ bool fragmentWritesMemory(std::span<const CompiledShader> shaders) {
     return false;
 }
 
-bool libraryKeys(PipelineLibraryKeys& keys, const Context& context, const State& state, const VertexInputLayout& input, const ShaderResources& resources, std::span<const CompiledShader> shaders) {
+bool libraryKeys(PipelineLibraryKeys& keys, const Context& context, const State& state, const VertexInputLayout& input, const ShaderResources& resources, std::span<const CompiledShader> shaders, bool sampleLocationsEnabled) {
     using Stage = ShaderRecompiler::ShaderStage;
     if (!context.graphicsPipelineLibrary || context.pipelineExecutableInfo || state.depthBiasPerFace || state.rectList || SplitsAlternateAlpha(state)) return false;
     keys = {};
@@ -199,6 +199,8 @@ bool libraryKeys(PipelineLibraryKeys& keys, const Context& context, const State&
     appendKey(keys.fragmentOutput, state.samples);
     appendKey(keys.fragmentShader, state.customSampleLocations);
     appendKey(keys.fragmentOutput, state.customSampleLocations);
+    appendKey(keys.fragmentShader, sampleLocationsEnabled);
+    appendKey(keys.fragmentOutput, sampleLocationsEnabled);
     if (state.customSampleLocations) {
         appendKey(keys.fragmentShader, state.sampleLocations);
         appendKey(keys.fragmentOutput, state.sampleLocations);
@@ -356,7 +358,7 @@ Pipeline::Pipeline(const Context& context, const State& state, const VertexInput
         viewports.viewportCount = 1;
         viewports.scissorCount = 1;
         PipelineLibraryKeys keys;
-        libraries = libraryKeys(keys, context, state, vertexInput, resources, shaders);
+        libraries = libraryKeys(keys, context, state, vertexInput, resources, shaders, sampleLocationsEnabled);
         std::vector<VkDynamicState> dynamicStates{VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR};
         if (depthBounds) dynamicStates.push_back(VK_DYNAMIC_STATE_DEPTH_BOUNDS);
         if (depthBias) dynamicStates.push_back(VK_DYNAMIC_STATE_DEPTH_BIAS);
diff --git a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
index 965679d..26faff6 100644
--- a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
+++ b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
@@ -2,6 +2,7 @@
 #include "GraphicsTests.hpp"
 #include "prx/libSceAgcDriver/Execution/include/GuestMemory.hpp"
 #include "prx/libSceAgcDriver/Graphics/include/Recorder.hpp"
+#include "prx/libSceAgcDriver/Graphics/include/PipelineLibrary.hpp"
 #include "prx/libSceAgcDriver/Graphics/include/Pipeline.hpp"
 #include "prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp"
 #include "prx/libSceAgcDriver/Graphics/include/VertexInput.hpp"
@@ -1621,6 +1622,14 @@ VKAPI_ATTR VkResult VKAPI_CALL sampleLocationDepthProperties(VkPhysicalDevice, V
     return depthSampleResult;
 }
 
+VKAPI_ATTR VkResult VKAPI_CALL pipelineLibraryDepthProperties(VkPhysicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* properties) {
+    Require((format == VK_FORMAT_D32_SFLOAT || format == VK_FORMAT_D16_UNORM || format == VK_FORMAT_X8_D24_UNORM_PACK32) && type == VK_IMAGE_TYPE_2D && tiling == VK_IMAGE_TILING_OPTIMAL, "pipeline library depth query changed the format or type");
+    Require(usage == (VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT) && flags == VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, "pipeline library depth query changed the image usage or flags");
+    if (format == VK_FORMAT_D32_SFLOAT) return VK_ERROR_FORMAT_NOT_SUPPORTED;
+    properties->sampleCounts = format == VK_FORMAT_D16_UNORM ? VK_SAMPLE_COUNT_2_BIT : VK_SAMPLE_COUNT_4_BIT;
+    return VK_SUCCESS;
+}
+
 void multisampleTests() {
     using AgcDriver::Graphics::ColorMetadataPass;
     using AgcDriver::Graphics::DecodeColorMetadataPass;
@@ -1939,6 +1948,13 @@ struct MockDescriptorWrite {
     std::vector<VkDescriptorBufferInfo> buffers;
 };
 
+struct MockPipelineLibrary {
+    VkGraphicsPipelineLibraryFlagsEXT part = 0;
+    VkSampleCountFlagBits samples{};
+    bool sampleLocationsEnabled = false;
+    std::vector<VkSampleLocationEXT> locations;
+};
+
 struct MockVulkan {
     std::uint64_t next = 1;
     std::int64_t live = 0;
@@ -1976,6 +1992,8 @@ struct MockVulkan {
     VkPipelineBindPoint boundPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM;
     std::map<VkPipelineLayout, VkDeviceSize> pipelineLayoutPushConstantSize;
     std::uint32_t pipelineCreateCount = 0;
+    std::map<VkPipeline, MockPipelineLibrary> pipelineLibraries;
+    std::vector<std::array<VkPipeline, 4>> pipelineLinks;
     std::vector<std::array<std::uint32_t, 3>> pipelineSpecializations;
     VkPipeline boundPipeline = VK_NULL_HANDLE;
     std::vector<std::byte> lastPushConstants;
@@ -2166,7 +2184,40 @@ VKAPI_ATTR VkResult VKAPI_CALL mockCreateComputePipelines(VkDevice, VkPipelineCa
     return VK_SUCCESS;
 }
 
-VKAPI_ATTR void VKAPI_CALL mockDestroyPipeline(VkDevice, VkPipeline, const VkAllocationCallbacks*) {
+VKAPI_ATTR VkResult VKAPI_CALL mockCreateGraphicsPipelines(VkDevice, VkPipelineCache, std::uint32_t count, const VkGraphicsPipelineCreateInfo* infos, const VkAllocationCallbacks*, VkPipeline* pipelines) {
+    Require(count == 1 && infos->pNext != nullptr, "mock expects one graphics pipeline library or link");
+    *pipelines = makeHandle<VkPipeline>();
+    if ((infos->flags & VK_PIPELINE_CREATE_LIBRARY_BIT_KHR) != 0) {
+        const auto* library = static_cast<const VkGraphicsPipelineLibraryCreateInfoEXT*>(infos->pNext);
+        Require(library->sType == VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT, "graphics library flags are missing");
+        MockPipelineLibrary result;
+        result.part = library->flags;
+        if (infos->pMultisampleState != nullptr) {
+            result.samples = infos->pMultisampleState->rasterizationSamples;
+            if (const auto* locations = static_cast<const VkPipelineSampleLocationsStateCreateInfoEXT*>(infos->pMultisampleState->pNext)) {
+                Require(locations->sType == VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT && locations->sampleLocationsEnable, "graphics sample locations are disabled");
+                result.sampleLocationsEnabled = true;
+                const auto& sampleInfo = locations->sampleLocationsInfo;
+                Require(sampleInfo.sampleLocationsPerPixel == result.samples && sampleInfo.sampleLocationsCount == result.samples, "graphics sample location count differs from rasterization samples");
+                result.locations.assign(sampleInfo.pSampleLocations, sampleInfo.pSampleLocations + sampleInfo.sampleLocationsCount);
+            }
+        }
+        mock.pipelineLibraries.emplace(*pipelines, std::move(result));
+    } else {
+        const auto* linked = static_cast<const VkPipelineLibraryCreateInfoKHR*>(infos->pNext);
+        Require(infos->flags == 0 && linked->sType == VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR && linked->libraryCount == 4, "graphics pipeline did not link four cached parts");
+        std::array<VkPipeline, 4> libraries{};
+        std::copy_n(linked->pLibraries, libraries.size(), libraries.begin());
+        Require(mock.pipelineLibraries.at(libraries[2]).sampleLocationsEnabled == mock.pipelineLibraries.at(libraries[3]).sampleLocationsEnabled, "linked fragment libraries disagree on sample-location enablement");
+        mock.pipelineLinks.push_back(libraries);
+    }
+    ++mock.pipelineCreateCount;
+    ++mock.live;
+    return VK_SUCCESS;
+}
+
+VKAPI_ATTR void VKAPI_CALL mockDestroyPipeline(VkDevice, VkPipeline pipeline, const VkAllocationCallbacks*) {
+    mock.pipelineLibraries.erase(pipeline);
     --mock.live;
 }
 
@@ -2251,6 +2302,7 @@ PFN_vkVoidFunction VKAPI_CALL mockProc(VkDevice, const char* name) {
         {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(mockCreateShaderModule)},
         {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(mockDestroyShaderModule)},
         {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(mockCreateComputePipelines)},
+        {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(mockCreateGraphicsPipelines)},
         {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(mockDestroyPipeline)},
         {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(mockCmdBindPipeline)},
         {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(mockCmdPushConstants)},
@@ -3066,6 +3118,121 @@ std::vector<std::uint32_t> makeModule(const ModuleShape& shape) {
     return words;
 }
 
+void pipelineLibrarySampleTests() {
+    using namespace AgcDriver::Graphics;
+    mock = MockVulkan{};
+    auto context = mockContext();
+    context.device = makeHandle<VkDevice>();
+    context.graphicsPipelineLibrary = true;
+    context.pipelineLinkTimeOptimization = false;
+    context.sampleLocationSampleCounts = VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT | VK_SAMPLE_COUNT_8_BIT;
+    context.limits.framebufferNoAttachmentsSampleCounts = context.sampleLocationSampleCounts;
+    context.limits.framebufferDepthSampleCounts = VK_SAMPLE_COUNT_4_BIT;
+    context.limits.maxPushConstantsSize = PipelinePushConstantBytes;
+    context.imageFormatProperties = pipelineLibraryDepthProperties;
+    {
+        ShaderRecompiler::RecompileResult vertex, fragment;
+        vertex.spirv = makeModule({});
+        fragment.spirv = makeModule({.fragment = true});
+        vertex.variantId = 1;
+        fragment.variantId = 2;
+        const std::array<CompiledShader, 2> shaders{{{ShaderRecompiler::ShaderStage::Vertex, &vertex, 0}, {ShaderRecompiler::ShaderStage::Fragment, &fragment, PipelinePushSlotBytes}}};
+        State state{};
+        state.depthBias = false;
+        state.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+        const ShaderResources resources(context, shaders, state.color, 0, 0, 0);
+        const auto build = [&](const State& samples, const std::array<std::uint64_t, 4>& expected, bool sampleLocationsEnabled = true) {
+            const auto links = mock.pipelineLinks.size();
+            { Pipeline pipeline(context, samples, {}, resources, shaders); }
+            const auto counters = PipelineLibraryCountersOf(context.device);
+            Require(mock.pipelineLinks.size() == links + 1 && counters.linked == links + 1 && counters.optimized == 0, "the sample-state test did not link through the pipeline library cache");
+            Require(counters.built == expected, "sample state rebuilt the wrong pipeline library parts");
+            const auto libraries = mock.pipelineLinks.back();
+            const auto locations = SampleLocations(samples);
+            constexpr std::array<VkGraphicsPipelineLibraryFlagsEXT, 4> parts{
+                VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT,
+                VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
+                VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT,
+                VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
+            };
+            for (std::size_t part = 0; part < libraries.size(); ++part) {
+                const auto& library = mock.pipelineLibraries.at(libraries[part]);
+                Require(library.part == parts[part], "sample-state pipeline linked the wrong library part");
+                if (part < 2) continue;
+                Require(library.samples == samples.samples, "a fragment library reused another sample count");
+                Require(library.sampleLocationsEnabled == sampleLocationsEnabled && library.locations.size() == (sampleLocationsEnabled ? samples.samples : 0u), "a fragment library reused another sample-location enablement state");
+                for (std::size_t sample = 0; sample < library.locations.size(); ++sample) Require(library.locations[sample].x == locations[sample].x && library.locations[sample].y == locations[sample].y, "a fragment library reused another sample pattern or sample index");
+            }
+            return libraries;
+        };
+        const auto compare = [&](const State& first, const State& second, bool changed) {
+            ClearPipelineLibraries(context.device);
+            mock.pipelineLinks.clear();
+            const auto before = build(first, {1, 1, 1, 1});
+            const std::array<std::uint64_t, 4> expected{1, 1, changed ? 2u : 1u, changed ? 2u : 1u};
+            const auto after = build(second, expected);
+            Require(before[0] == after[0] && before[1] == after[1], "sample state rebuilt vertex-input or pre-rasterization libraries");
+            Require((before[2] != after[2]) == changed && (before[3] != after[3]) == changed, "fragment library handles did not follow sample state");
+            Require(build(second, expected) == after, "repeating sample state did not reuse every library");
+        };
+        for (const auto count : {2u, 4u, 8u}) {
+            auto next = state;
+            next.samples = count;
+            compare(state, next, true);
+            state = next;
+        }
+        state.samples = 2;
+        state.sampleLocations = {0x4c, 0xc4};
+        auto custom = state;
+        custom.customSampleLocations = true;
+        compare(state, custom, true);
+        auto reordered = custom;
+        std::swap(reordered.sampleLocations[0], reordered.sampleLocations[1]);
+        compare(custom, reordered, true);
+        auto ignored = state;
+        ignored.sampleLocations.fill(0xff);
+        compare(state, ignored, false);
+        compare(custom, custom, false);
+        for (const auto count : {1u, 2u, 4u, 8u}) {
+            custom.samples = count;
+            auto pattern = custom;
+            pattern.sampleLocations[count - 1] ^= 1;
+            compare(custom, pattern, true);
+        }
+        state.samples = 4;
+        auto compatible = state;
+        compatible.depth = DepthTarget{};
+        compatible.depth->format = VK_FORMAT_X8_D24_UNORM_PACK32;
+        compatible.depth->samples = state.samples;
+        const auto compareEnablement = [&](const State& first, bool firstEnabled, const State& second, bool secondEnabled) {
+            ClearPipelineLibraries(context.device);
+            mock.pipelineLinks.clear();
+            const auto before = build(first, {1, 1, 1, 1}, firstEnabled);
+            const bool shaderChanged = firstEnabled != secondEnabled;
+            const std::array<std::uint64_t, 4> expected{1, 1, shaderChanged ? 2u : 1u, 2};
+            const auto after = build(second, expected, secondEnabled);
+            Require(before[0] == after[0] && before[1] == after[1], "sample-location enablement rebuilt vertex-input or pre-rasterization libraries");
+            Require((before[2] != after[2]) == shaderChanged && before[3] != after[3], "sample-location enablement changed the wrong fragment libraries");
+            Require(build(second, expected, secondEnabled) == after, "repeating sample-location enablement did not reuse every library");
+            Require(build(first, expected, firstEnabled) == before, "returning to sample-location enablement did not reuse every library");
+        };
+        for (const auto format : {VK_FORMAT_D32_SFLOAT, VK_FORMAT_D16_UNORM}) {
+            auto depth = state;
+            depth.depth = DepthTarget{};
+            depth.depth->format = format;
+            depth.depth->samples = state.samples;
+            compareEnablement(state, true, depth, false);
+            compareEnablement(depth, false, state, true);
+            compareEnablement(compatible, true, depth, false);
+            compareEnablement(depth, false, compatible, true);
+        }
+        compareEnablement(state, true, compatible, true);
+        compareEnablement(compatible, true, state, true);
+        ClearPipelineLibraries(context.device);
+    }
+    Require(mock.live == 0 && mock.pipelineLibraries.empty(), "pipeline library sample tests leaked Vulkan objects");
+}
+
 void barycentricEmulationTests() {
     using namespace ShaderRecompiler;
     using namespace AgcDriver::Graphics;
@@ -4555,6 +4722,7 @@ int main(int argc, char** argv) {
         pixelParameterSlotTests();
         rectListTests();
         floatControlsModeTests();
+        pipelineLibrarySampleTests();
         barycentricEmulationTests();
         mock = MockVulkan{};
         auto bdaContext = mockContext();
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111801390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6111801390). Originally posted by [cookie42073-cmd](https://github.com/cookie42073-cmd) on 2026-10-11T17:38:46Z. --- Hi, I’m Blazing Cook. Here’s an update on the fix and the Windows testing. **Updated verification on PR #2169 head `589d42b7cc7d76193be93999d3d41eae5a0b0d32`.** This replaces the older `505aa13e`/`27c69c12` test evidence and patch in this comment. The current keys include the sample count and custom pattern, but still omit the **resolved `sampleLocationsEnabled`** value. On a fixed-capability device, changing to an incompatible depth format can disable standard sample locations while the fragment-shader library still reuses its previous enabled state. The linked multisample definitions then disagree ([Vulkan VUID 06635](https://docs.vulkan.org/refpages/latest/refpages/source/VkGraphicsPipelineCreateInfo.html#VUID-VkGraphicsPipelineCreateInfo-pLibraries-06635)). The correction passes the already resolved boolean into the private key builder and appends it to both fragment keys. It preserves this head's full-array custom-pattern keys and adds no capability query. **Windows results:** MinGW-w64 GCC 15.2.0, Release, bundled dependencies, SPIRV-Tools off (the project default). The full default build passed. With identical regression bytes throughout: | Variant | Result | | --- | --- | | Original `589d42b7` key | Expected failure: `linked fragment libraries disagree on sample-location enablement`; test 0.81 s | | Deliberately incorrect depth-presence key | Same expected failure; test 0.74 s | | Resolved-enable key | Graphics 6.34 s, depth-fast-clear 0.63 s, depth-fast-clear-submit 0.72 s; **3/3 passed, 7.75 s total** | Five existing pipeline tests also passed in **1.86 s total**: cache, normal GPL reuse, GPL-disabled fallback, fast-only GPL reuse, and the link-optimization policy unit test. These are four real-Vulkan invocations plus one policy test; the disabled-GPL run correctly used whole pipelines. No CTest skips occurred. Shader caches were disabled and each test retained its 30 s cap. The permanent regression uses the production `Pipeline` constructor and library cache with mocked Vulkan creation callbacks. It covers **11 sample/pattern comparisons and 10 four-build enablement transitions**: unsupported-format and supported-format/missing-4x outcomes, both directions, repeats and return reuse, incompatible/compatible formats with depth present on both sides, and no-depth/compatible-depth preserving fragment-shader reuse. Vertex parts remain reused. The native tests are additional coverage; they do not exercise this exact mocked depth-enable matrix or prove background LTO. Local review-support commit: `d8445c6460ded28000b3abc49586ee3d4a0737cf`, directly on the pinned PR head. The two-file patch below includes the required mock support; it does not depend on our old local integration. The current-main conventions checker passed for this topic delta. Both project chats independently reviewed the patch and test evidence. A self-contained source checkpoint restored all 2,057 source blobs and passed strict Git integrity checks; raw logs are preserved locally. This verifies the cache correction on the pinned PR head. It is not a merge with current `main`, full CI, Linux validation, native reproduction of the depth-enable matrix, or a demonstrated title fix. No duplicate MSAA feature PR is being opened. **Community testing request:** Could someone check this transition with native GPL on another GPU/driver, or link an existing small test that reaches it? Please include the exact commit and dependency/patch stack, GPU/driver, OS, settings, and paired startup-to-first-failure logs using the same reproduction steps. For the separate MSAA memory problem in [#419](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6111743077), we still need the intervening writer and completion history. Useful evidence would be: - The exact prerequisite RUDP-export commits and full title/homebrew version for the reported stack. - A sanitized capture showing target creation, allocations/remaps and aliases, CPU/DMA/GPU writes, completion points, and the first rejected read. Address overlap alone does not identify the last writer or prove a complete overwrite. - A small redistributable homebrew/source test that initializes distinct samples, overwrites only part of the image, then reads/copies/resolves it and checks that untouched samples survive. A depth/stencil initialization case would help too. Links to existing logs or issues are welcome. Testers can run their own local game copies and share observations; please share logs or redistributable repros rather than commercial game files, firmware or keys. The diagnostic prototype is still local and is not being offered as a verified title build. AI-assisted with **Codex, including Astra**, with coordinated review across both project chats. Original #2169 and #419 authorship remains with authurtabo-byte and MichonGoddijn231849. <details> <summary>Resolved-enablement correction and permanent regression, directly against 589d42b7</summary> ```diff From d8445c6460ded28000b3abc49586ee3d4a0737cf Mon Sep 17 00:00:00 2001 From: Blazing Cook <324818824+[email protected]> Date: Sun, 11 Oct 2026 16:02:00 -0500 Subject: [PATCH] fix(agc): key resolved sample-location enablement Pass the already resolved sampleLocationsEnabled value to the private library key builder and include it in both fragment-library keys. Depth format support can disable standard sample locations on a fixed device; reusing an enabled fragment shader library then links inconsistent state. Add production Pipeline/cache regression coverage with immutable mocked capabilities. Preserve upstream full-array sample keys. Cover eleven sample/pattern comparisons and ten four-build enablement transitions, including compatible-depth shader reuse and both unsupported query forms. Windows MinGW GCC 15.2.0 Release: full default build passes. Identical regression bytes fail on the original key and a depth-presence proxy; the correction passes three focused tests in 7.75 seconds. Five existing pipeline tests pass in 1.86 seconds, including native GPL reuse, disabled GPL fallback and fast-only mode. The new enablement matrix is mocked; no native depth-transition, Linux CI or title compatibility is claimed. Contribution: Blazing Cook. AI-assisted: Codex, including Astra and an independent review in the other project chat. Based directly on PR #2169 at 589d42b7. Original #2169 and #419 authorship stays with authurtabo-byte and MichonGoddijn231849. This is review support for the existing PR. --- .../libSceAgcDriver/Graphics/src/Pipeline.cpp | 6 +- .../prx/libSceAgcDriver/tests/Graphics.cpp | 170 +++++++++++++++++- 2 files changed, 173 insertions(+), 3 deletions(-) diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp index ce5d021..df4462e 100644 --- a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp @@ -163,7 +163,7 @@ bool fragmentWritesMemory(std::span<const CompiledShader> shaders) { return false; } -bool libraryKeys(PipelineLibraryKeys& keys, const Context& context, const State& state, const VertexInputLayout& input, const ShaderResources& resources, std::span<const CompiledShader> shaders) { +bool libraryKeys(PipelineLibraryKeys& keys, const Context& context, const State& state, const VertexInputLayout& input, const ShaderResources& resources, std::span<const CompiledShader> shaders, bool sampleLocationsEnabled) { using Stage = ShaderRecompiler::ShaderStage; if (!context.graphicsPipelineLibrary || context.pipelineExecutableInfo || state.depthBiasPerFace || state.rectList || SplitsAlternateAlpha(state)) return false; keys = {}; @@ -199,6 +199,8 @@ bool libraryKeys(PipelineLibraryKeys& keys, const Context& context, const State& appendKey(keys.fragmentOutput, state.samples); appendKey(keys.fragmentShader, state.customSampleLocations); appendKey(keys.fragmentOutput, state.customSampleLocations); + appendKey(keys.fragmentShader, sampleLocationsEnabled); + appendKey(keys.fragmentOutput, sampleLocationsEnabled); if (state.customSampleLocations) { appendKey(keys.fragmentShader, state.sampleLocations); appendKey(keys.fragmentOutput, state.sampleLocations); @@ -356,7 +358,7 @@ Pipeline::Pipeline(const Context& context, const State& state, const VertexInput viewports.viewportCount = 1; viewports.scissorCount = 1; PipelineLibraryKeys keys; - libraries = libraryKeys(keys, context, state, vertexInput, resources, shaders); + libraries = libraryKeys(keys, context, state, vertexInput, resources, shaders, sampleLocationsEnabled); std::vector<VkDynamicState> dynamicStates{VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR}; if (depthBounds) dynamicStates.push_back(VK_DYNAMIC_STATE_DEPTH_BOUNDS); if (depthBias) dynamicStates.push_back(VK_DYNAMIC_STATE_DEPTH_BIAS); diff --git a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp index 965679d..26faff6 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp @@ -2,6 +2,7 @@ #include "GraphicsTests.hpp" #include "prx/libSceAgcDriver/Execution/include/GuestMemory.hpp" #include "prx/libSceAgcDriver/Graphics/include/Recorder.hpp" +#include "prx/libSceAgcDriver/Graphics/include/PipelineLibrary.hpp" #include "prx/libSceAgcDriver/Graphics/include/Pipeline.hpp" #include "prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp" #include "prx/libSceAgcDriver/Graphics/include/VertexInput.hpp" @@ -1621,6 +1622,14 @@ VKAPI_ATTR VkResult VKAPI_CALL sampleLocationDepthProperties(VkPhysicalDevice, V return depthSampleResult; } +VKAPI_ATTR VkResult VKAPI_CALL pipelineLibraryDepthProperties(VkPhysicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* properties) { + Require((format == VK_FORMAT_D32_SFLOAT || format == VK_FORMAT_D16_UNORM || format == VK_FORMAT_X8_D24_UNORM_PACK32) && type == VK_IMAGE_TYPE_2D && tiling == VK_IMAGE_TILING_OPTIMAL, "pipeline library depth query changed the format or type"); + Require(usage == (VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT) && flags == VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, "pipeline library depth query changed the image usage or flags"); + if (format == VK_FORMAT_D32_SFLOAT) return VK_ERROR_FORMAT_NOT_SUPPORTED; + properties->sampleCounts = format == VK_FORMAT_D16_UNORM ? VK_SAMPLE_COUNT_2_BIT : VK_SAMPLE_COUNT_4_BIT; + return VK_SUCCESS; +} + void multisampleTests() { using AgcDriver::Graphics::ColorMetadataPass; using AgcDriver::Graphics::DecodeColorMetadataPass; @@ -1939,6 +1948,13 @@ struct MockDescriptorWrite { std::vector<VkDescriptorBufferInfo> buffers; }; +struct MockPipelineLibrary { + VkGraphicsPipelineLibraryFlagsEXT part = 0; + VkSampleCountFlagBits samples{}; + bool sampleLocationsEnabled = false; + std::vector<VkSampleLocationEXT> locations; +}; + struct MockVulkan { std::uint64_t next = 1; std::int64_t live = 0; @@ -1976,6 +1992,8 @@ struct MockVulkan { VkPipelineBindPoint boundPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM; std::map<VkPipelineLayout, VkDeviceSize> pipelineLayoutPushConstantSize; std::uint32_t pipelineCreateCount = 0; + std::map<VkPipeline, MockPipelineLibrary> pipelineLibraries; + std::vector<std::array<VkPipeline, 4>> pipelineLinks; std::vector<std::array<std::uint32_t, 3>> pipelineSpecializations; VkPipeline boundPipeline = VK_NULL_HANDLE; std::vector<std::byte> lastPushConstants; @@ -2166,7 +2184,40 @@ VKAPI_ATTR VkResult VKAPI_CALL mockCreateComputePipelines(VkDevice, VkPipelineCa return VK_SUCCESS; } -VKAPI_ATTR void VKAPI_CALL mockDestroyPipeline(VkDevice, VkPipeline, const VkAllocationCallbacks*) { +VKAPI_ATTR VkResult VKAPI_CALL mockCreateGraphicsPipelines(VkDevice, VkPipelineCache, std::uint32_t count, const VkGraphicsPipelineCreateInfo* infos, const VkAllocationCallbacks*, VkPipeline* pipelines) { + Require(count == 1 && infos->pNext != nullptr, "mock expects one graphics pipeline library or link"); + *pipelines = makeHandle<VkPipeline>(); + if ((infos->flags & VK_PIPELINE_CREATE_LIBRARY_BIT_KHR) != 0) { + const auto* library = static_cast<const VkGraphicsPipelineLibraryCreateInfoEXT*>(infos->pNext); + Require(library->sType == VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT, "graphics library flags are missing"); + MockPipelineLibrary result; + result.part = library->flags; + if (infos->pMultisampleState != nullptr) { + result.samples = infos->pMultisampleState->rasterizationSamples; + if (const auto* locations = static_cast<const VkPipelineSampleLocationsStateCreateInfoEXT*>(infos->pMultisampleState->pNext)) { + Require(locations->sType == VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT && locations->sampleLocationsEnable, "graphics sample locations are disabled"); + result.sampleLocationsEnabled = true; + const auto& sampleInfo = locations->sampleLocationsInfo; + Require(sampleInfo.sampleLocationsPerPixel == result.samples && sampleInfo.sampleLocationsCount == result.samples, "graphics sample location count differs from rasterization samples"); + result.locations.assign(sampleInfo.pSampleLocations, sampleInfo.pSampleLocations + sampleInfo.sampleLocationsCount); + } + } + mock.pipelineLibraries.emplace(*pipelines, std::move(result)); + } else { + const auto* linked = static_cast<const VkPipelineLibraryCreateInfoKHR*>(infos->pNext); + Require(infos->flags == 0 && linked->sType == VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR && linked->libraryCount == 4, "graphics pipeline did not link four cached parts"); + std::array<VkPipeline, 4> libraries{}; + std::copy_n(linked->pLibraries, libraries.size(), libraries.begin()); + Require(mock.pipelineLibraries.at(libraries[2]).sampleLocationsEnabled == mock.pipelineLibraries.at(libraries[3]).sampleLocationsEnabled, "linked fragment libraries disagree on sample-location enablement"); + mock.pipelineLinks.push_back(libraries); + } + ++mock.pipelineCreateCount; + ++mock.live; + return VK_SUCCESS; +} + +VKAPI_ATTR void VKAPI_CALL mockDestroyPipeline(VkDevice, VkPipeline pipeline, const VkAllocationCallbacks*) { + mock.pipelineLibraries.erase(pipeline); --mock.live; } @@ -2251,6 +2302,7 @@ PFN_vkVoidFunction VKAPI_CALL mockProc(VkDevice, const char* name) { {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(mockCreateShaderModule)}, {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(mockDestroyShaderModule)}, {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(mockCreateComputePipelines)}, + {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(mockCreateGraphicsPipelines)}, {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(mockDestroyPipeline)}, {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(mockCmdBindPipeline)}, {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(mockCmdPushConstants)}, @@ -3066,6 +3118,121 @@ std::vector<std::uint32_t> makeModule(const ModuleShape& shape) { return words; } +void pipelineLibrarySampleTests() { + using namespace AgcDriver::Graphics; + mock = MockVulkan{}; + auto context = mockContext(); + context.device = makeHandle<VkDevice>(); + context.graphicsPipelineLibrary = true; + context.pipelineLinkTimeOptimization = false; + context.sampleLocationSampleCounts = VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT | VK_SAMPLE_COUNT_8_BIT; + context.limits.framebufferNoAttachmentsSampleCounts = context.sampleLocationSampleCounts; + context.limits.framebufferDepthSampleCounts = VK_SAMPLE_COUNT_4_BIT; + context.limits.maxPushConstantsSize = PipelinePushConstantBytes; + context.imageFormatProperties = pipelineLibraryDepthProperties; + { + ShaderRecompiler::RecompileResult vertex, fragment; + vertex.spirv = makeModule({}); + fragment.spirv = makeModule({.fragment = true}); + vertex.variantId = 1; + fragment.variantId = 2; + const std::array<CompiledShader, 2> shaders{{{ShaderRecompiler::ShaderStage::Vertex, &vertex, 0}, {ShaderRecompiler::ShaderStage::Fragment, &fragment, PipelinePushSlotBytes}}}; + State state{}; + state.depthBias = false; + state.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + const ShaderResources resources(context, shaders, state.color, 0, 0, 0); + const auto build = [&](const State& samples, const std::array<std::uint64_t, 4>& expected, bool sampleLocationsEnabled = true) { + const auto links = mock.pipelineLinks.size(); + { Pipeline pipeline(context, samples, {}, resources, shaders); } + const auto counters = PipelineLibraryCountersOf(context.device); + Require(mock.pipelineLinks.size() == links + 1 && counters.linked == links + 1 && counters.optimized == 0, "the sample-state test did not link through the pipeline library cache"); + Require(counters.built == expected, "sample state rebuilt the wrong pipeline library parts"); + const auto libraries = mock.pipelineLinks.back(); + const auto locations = SampleLocations(samples); + constexpr std::array<VkGraphicsPipelineLibraryFlagsEXT, 4> parts{ + VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT, + VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT, + VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, + VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT, + }; + for (std::size_t part = 0; part < libraries.size(); ++part) { + const auto& library = mock.pipelineLibraries.at(libraries[part]); + Require(library.part == parts[part], "sample-state pipeline linked the wrong library part"); + if (part < 2) continue; + Require(library.samples == samples.samples, "a fragment library reused another sample count"); + Require(library.sampleLocationsEnabled == sampleLocationsEnabled && library.locations.size() == (sampleLocationsEnabled ? samples.samples : 0u), "a fragment library reused another sample-location enablement state"); + for (std::size_t sample = 0; sample < library.locations.size(); ++sample) Require(library.locations[sample].x == locations[sample].x && library.locations[sample].y == locations[sample].y, "a fragment library reused another sample pattern or sample index"); + } + return libraries; + }; + const auto compare = [&](const State& first, const State& second, bool changed) { + ClearPipelineLibraries(context.device); + mock.pipelineLinks.clear(); + const auto before = build(first, {1, 1, 1, 1}); + const std::array<std::uint64_t, 4> expected{1, 1, changed ? 2u : 1u, changed ? 2u : 1u}; + const auto after = build(second, expected); + Require(before[0] == after[0] && before[1] == after[1], "sample state rebuilt vertex-input or pre-rasterization libraries"); + Require((before[2] != after[2]) == changed && (before[3] != after[3]) == changed, "fragment library handles did not follow sample state"); + Require(build(second, expected) == after, "repeating sample state did not reuse every library"); + }; + for (const auto count : {2u, 4u, 8u}) { + auto next = state; + next.samples = count; + compare(state, next, true); + state = next; + } + state.samples = 2; + state.sampleLocations = {0x4c, 0xc4}; + auto custom = state; + custom.customSampleLocations = true; + compare(state, custom, true); + auto reordered = custom; + std::swap(reordered.sampleLocations[0], reordered.sampleLocations[1]); + compare(custom, reordered, true); + auto ignored = state; + ignored.sampleLocations.fill(0xff); + compare(state, ignored, false); + compare(custom, custom, false); + for (const auto count : {1u, 2u, 4u, 8u}) { + custom.samples = count; + auto pattern = custom; + pattern.sampleLocations[count - 1] ^= 1; + compare(custom, pattern, true); + } + state.samples = 4; + auto compatible = state; + compatible.depth = DepthTarget{}; + compatible.depth->format = VK_FORMAT_X8_D24_UNORM_PACK32; + compatible.depth->samples = state.samples; + const auto compareEnablement = [&](const State& first, bool firstEnabled, const State& second, bool secondEnabled) { + ClearPipelineLibraries(context.device); + mock.pipelineLinks.clear(); + const auto before = build(first, {1, 1, 1, 1}, firstEnabled); + const bool shaderChanged = firstEnabled != secondEnabled; + const std::array<std::uint64_t, 4> expected{1, 1, shaderChanged ? 2u : 1u, 2}; + const auto after = build(second, expected, secondEnabled); + Require(before[0] == after[0] && before[1] == after[1], "sample-location enablement rebuilt vertex-input or pre-rasterization libraries"); + Require((before[2] != after[2]) == shaderChanged && before[3] != after[3], "sample-location enablement changed the wrong fragment libraries"); + Require(build(second, expected, secondEnabled) == after, "repeating sample-location enablement did not reuse every library"); + Require(build(first, expected, firstEnabled) == before, "returning to sample-location enablement did not reuse every library"); + }; + for (const auto format : {VK_FORMAT_D32_SFLOAT, VK_FORMAT_D16_UNORM}) { + auto depth = state; + depth.depth = DepthTarget{}; + depth.depth->format = format; + depth.depth->samples = state.samples; + compareEnablement(state, true, depth, false); + compareEnablement(depth, false, state, true); + compareEnablement(compatible, true, depth, false); + compareEnablement(depth, false, compatible, true); + } + compareEnablement(state, true, compatible, true); + compareEnablement(compatible, true, state, true); + ClearPipelineLibraries(context.device); + } + Require(mock.live == 0 && mock.pipelineLibraries.empty(), "pipeline library sample tests leaked Vulkan objects"); +} + void barycentricEmulationTests() { using namespace ShaderRecompiler; using namespace AgcDriver::Graphics; @@ -4555,6 +4722,7 @@ int main(int argc, char** argv) { pixelParameterSlotTests(); rectListTests(); floatControlsModeTests(); + pipelineLibrarySampleTests(); barycentricEmulationTests(); mock = MockVulkan{}; auto bdaContext = mockContext(); ``` </details>
adriadam10 commented 2026-10-11 20:51:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T20:51:30Z.

Review: DISMISSED


Thanks for adding the sample count and pattern to the fragment keys; that covers the earlier request. Built the PR merged onto main and ran the libSceAgcDriver ctest scope (391/391 pass, including agc_driver_graphics and agc_driver_prepared_graphics).

One thing left, also reported by @cookie42073-cmd:

  • libraryKeys (Graphics/src/Pipeline.cpp:197-205): the resolved sampleLocationsEnabled from ValidateSampleLocations (Pipeline.cpp:110-115) depends on the depth format, but isn't part of keys.fragmentShader / keys.fragmentOutput. Two draws with the same pattern and sample count but a compatible vs. incompatible depth format can reuse a library built with the other enablement, which links different multisample states (VUID 06635). Append the resolved value to both keys and add a case with the same pattern and two depth formats.

Still stacked on #419; this will wait for it to land, then rebase so it only carries its own commit.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5484903468 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#pullrequestreview-5484903468). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T20:51:30Z. **Review:** DISMISSED --- Thanks for adding the sample count and pattern to the fragment keys; that covers the earlier request. Built the PR merged onto main and ran the libSceAgcDriver ctest scope (391/391 pass, including `agc_driver_graphics` and `agc_driver_prepared_graphics`). One thing left, also reported by @cookie42073-cmd: - `libraryKeys` (`Graphics/src/Pipeline.cpp:197-205`): the resolved `sampleLocationsEnabled` from `ValidateSampleLocations` (`Pipeline.cpp:110-115`) depends on the depth format, but isn't part of `keys.fragmentShader` / `keys.fragmentOutput`. Two draws with the same pattern and sample count but a compatible vs. incompatible depth format can reuse a library built with the other enablement, which links different multisample states (VUID 06635). Append the resolved value to both keys and add a case with the same pattern and two depth formats. Still stacked on #419; this will wait for it to land, then rebase so it only carries its own commit.
oneandonlydean commented 2026-10-12 02:12:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T02:12:45Z.


Can you rebase this please?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116526803 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6116526803). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T02:12:45Z. --- Can you rebase this please?
authurtabo-byte commented 2026-10-12 03:43:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by authurtabo-byte on 2026-10-12T03:43:32Z.


Thanks everyone for the review and title testing. I?ve pushed the rebased update; it is now based on current main and no longer includes the #419 commits.

  • GPL cache reuse (adriadam10, cookie42073-cmd): both fragment library keys now include sample count, the custom-pattern flag and active sample bytes, plus the resolved sample-locations-enabled value. That last value depends on depth-format compatibility, so compatible and incompatible depth states cannot reuse the wrong library. Recorder coverage checks pattern changes and, when this device exposes both cases, changes between compatible and incompatible depth formats.
  • Depth support and sample conversion (Raghav314): custom locations are still rejected when SAMPLE_LOCATIONS_COMPATIBLE_DEPTH is unavailable for the selected depth format and sample count. The standard 4? coordinate checks remain in Graphics tests.
  • Standard 8? table (Amoenus): corrected sample 7 from (7, -8) to (7, -7), avoiding treating that standard pattern as custom. The captured 8? pattern remains a useful independent regression report.
  • Title testing: the reports for Hades II (Raghav314) and Seeker: My Shadow (JAB-dev), plus the other shared title reports, are helpful confirmation of the original gameplay blocker and custom patterns. I did not reproduce Hades II here. I tried MiniGolf 3D as requested, but its packaged runtime modules are ABI-incompatible with the freshly built libraries (AgcDriver import, then libc import after rebuilding VideoOut), so it did not reach gameplay and is not claimed as a passing test.
  • Coverage/centroid observation (Amoenus): this change does not alter the existing refusal for the separate covered-centroid/coverage state. The register observation is useful, but changing that behavior needs its own equivalence validation.

Locally on Windows / AMD Radeon 780M, agc_driver_recorder_tests.exe --pipeline-library-only passes, including the new cache checks, and agc_driver_graphics_tests.exe passes. No PS5 hardware run is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117345581 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6117345581). Originally posted by [authurtabo-byte](https://github.com/authurtabo-byte) on 2026-10-12T03:43:32Z. --- Thanks everyone for the review and title testing. I?ve pushed the rebased update; it is now based on current `main` and no longer includes the #419 commits. - **GPL cache reuse (adriadam10, cookie42073-cmd):** both fragment library keys now include sample count, the custom-pattern flag and active sample bytes, plus the resolved sample-locations-enabled value. That last value depends on depth-format compatibility, so compatible and incompatible depth states cannot reuse the wrong library. Recorder coverage checks pattern changes and, when this device exposes both cases, changes between compatible and incompatible depth formats. - **Depth support and sample conversion (Raghav314):** custom locations are still rejected when `SAMPLE_LOCATIONS_COMPATIBLE_DEPTH` is unavailable for the selected depth format and sample count. The standard 4? coordinate checks remain in Graphics tests. - **Standard 8? table (Amoenus):** corrected sample 7 from `(7, -8)` to `(7, -7)`, avoiding treating that standard pattern as custom. The captured 8? pattern remains a useful independent regression report. - **Title testing:** the reports for Hades II (Raghav314) and Seeker: My Shadow (JAB-dev), plus the other shared title reports, are helpful confirmation of the original gameplay blocker and custom patterns. I did not reproduce Hades II here. I tried MiniGolf 3D as requested, but its packaged runtime modules are ABI-incompatible with the freshly built libraries (AgcDriver import, then libc import after rebuilding VideoOut), so it did not reach gameplay and is not claimed as a passing test. - **Coverage/centroid observation (Amoenus):** this change does not alter the existing refusal for the separate covered-centroid/coverage state. The register observation is useful, but changing that behavior needs its own equivalence validation. Locally on Windows / AMD Radeon 780M, `agc_driver_recorder_tests.exe --pipeline-library-only` passes, including the new cache checks, and `agc_driver_graphics_tests.exe` passes. No PS5 hardware run is claimed.
cookie42073-cmd commented 2026-10-12 18:20:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cookie42073-cmd on 2026-10-12T18:20:56Z.


Hi, Blazing Cook here. Following up on the earlier Ping Pong testing: we completed a full one-player match in Middle Ages Ping Pong on unmodified upstream 2a5eca11cd1bf583db39ce67034e8453842ac244, with restart and menu transitions working in the same run.

Tested STL1te's Middle Ages Ping Pong, PPSA28319 / 01.000.000, on Windows with an RTX 4070 SUPER. This was a fresh Release build with MinGW-w64 GCC 15.2.0 and a fresh relink, without local production patches or a diagnostic library overlay. Relink inputs were reconstructed from the release; packaged ELF headers and PT_LOAD payloads were independently matched. Original full-ELF equivalence is not claimed.

Using upstream tools/pad_input.py / APS5_PAD_INPUT_FILE, the saved frames show:

  • A one-player match starts at 0:0.
  • The match finishes 0:10, showing Defeat / Computer wins. I moved the player paddle aside to reach the end screen.
  • Restart resets the score to 0:0 and returns to the Serve prompt.
  • Options opens pause; selecting Main Menu returns to the title menu.
  • Starting another one-player match returns to 0:0.

The capture ran for 317.624 seconds, saving 314 raw GPU frames. It ended with a requested recorder stop after those checks. The recorded game exit code 1 is from that deliberate process termination; it is not a spontaneous crash or a graceful in-game exit. Neither game log contains the fatal, unsupported, assertion or Vulkan-error signatures checked by the analysis script.

The full default build and libs completed, and 12 selected memory, input and graphics tests passed, with Vulkan required and no skips. The full test suite was not run. FFmpeg used the existing upstream prebuilt package, with its recipe and file hashes recorded. A second Codex chat independently checked all 11 selected images against the original BMPs, the logs, build receipts and file hashes.

This is a compatibility follow-up after the upstream work in #419 and #2169, not an isolated before/after result for either change. Thanks to MichonGoddijn231849, authurtabo-byte and everyone who reviewed and tested them. STL1te is the homebrew author. There is no new code fix from this run.

Victory, two-player mode, physical input, fullscreen, audio quality, performance and PS5 pixel equivalence remain untested. Frame readback and disabled caches make this unsuitable as a performance benchmark. These results also do not establish any commercial-title memory failure.

If anyone reproduces a failure in this title, please share the exact AnyPS5 commit, title version, OS/GPU, reproduction steps and runtime log so we can compare it with this baseline.

AI-assisted: yes, Codex. The attached evidence contains logs, frames, scripts and verification receipts, with no game binaries or assets.

Evidence ZIP — SHA-256: d7aeda6e33b29c5b6fbace77c2fa7fc4be3eaa4806e5eb7eac4faf8090c3567a

Completed match, restart, main menu and fresh match

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6130076750 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2169#issuecomment-6130076750). Originally posted by [cookie42073-cmd](https://github.com/cookie42073-cmd) on 2026-10-12T18:20:56Z. --- Hi, Blazing Cook here. Following up on the earlier Ping Pong testing: **we completed a full one-player match in Middle Ages Ping Pong on unmodified upstream `2a5eca11cd1bf583db39ce67034e8453842ac244`**, with restart and menu transitions working in the same run. Tested STL1te's [Middle Ages Ping Pong](https://github.com/STL1te/MedievalTennis/releases/tag/01.000.000), **PPSA28319 / 01.000.000**, on Windows with an RTX 4070 SUPER. This was a fresh Release build with MinGW-w64 GCC 15.2.0 and a fresh relink, without local production patches or a diagnostic library overlay. Relink inputs were reconstructed from the release; packaged ELF headers and PT_LOAD payloads were independently matched. Original full-ELF equivalence is not claimed. Using upstream `tools/pad_input.py` / `APS5_PAD_INPUT_FILE`, the saved frames show: - A one-player match starts at **0:0**. - The match finishes **0:10**, showing **Defeat / Computer wins**. I moved the player paddle aside to reach the end screen. - **Restart** resets the score to **0:0** and returns to the Serve prompt. - **Options** opens pause; selecting **Main Menu** returns to the title menu. - Starting another one-player match returns to **0:0**. The capture ran for **317.624 seconds**, saving **314 raw GPU frames**. It ended with a requested recorder stop after those checks. The recorded game exit code 1 is from that deliberate process termination; it is not a spontaneous crash or a graceful in-game exit. Neither game log contains the fatal, unsupported, assertion or Vulkan-error signatures checked by the analysis script. The full default build and `libs` completed, and **12 selected memory, input and graphics tests passed**, with Vulkan required and no skips. The full test suite was not run. FFmpeg used the existing upstream prebuilt package, with its recipe and file hashes recorded. A second Codex chat independently checked all 11 selected images against the original BMPs, the logs, build receipts and file hashes. This is a compatibility follow-up after the upstream work in #419 and #2169, not an isolated before/after result for either change. Thanks to MichonGoddijn231849, authurtabo-byte and everyone who reviewed and tested them. STL1te is the homebrew author. There is no new code fix from this run. Victory, two-player mode, physical input, fullscreen, audio quality, performance and PS5 pixel equivalence remain untested. Frame readback and disabled caches make this unsuitable as a performance benchmark. These results also do not establish any commercial-title memory failure. If anyone reproduces a failure in this title, please share the exact AnyPS5 commit, title version, OS/GPU, reproduction steps and runtime log so we can compare it with this baseline. AI-assisted: yes, Codex. The attached evidence contains logs, frames, scripts and verification receipts, with no game binaries or assets. [Evidence ZIP](https://github.com/user-attachments/files/33349323/Blazing-Cook-Ping-Pong-complete-match-evidence.zip) — SHA-256: `d7aeda6e33b29c5b6fbace77c2fa7fc4be3eaa4806e5eb7eac4faf8090c3567a` ![Completed match, restart, main menu and fresh match](https://github.com/user-attachments/assets/516ff81a-bbcc-4efb-af43-9d88f068d7d4)
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!2169
No description provided.