feat(agc): read color-target merges through typed storage images #17056

Open
sherySJ wants to merge 14 commits from upstream-pr/17056 into main
sherySJ commented 2026-11-08 08:50:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by sherySJ on 2026-11-08T08:50:26Z.


What

Pixel-shader color-target merges read the merge image through a storage image declared with the target's format instead of a formatless one, so they run on GPUs without shaderStorageImageReadWithoutFormat (Intel Gen9 to Gen12.0 on Linux ANV and on the Windows Intel driver: HD 520/530/620/630, Ice Lake, Tiger Lake, Alder/Raptor Lake UHD 7xx). Until now EmitStorageImageRead refused every merge draw there (storage image reads without a format are unavailable on the target device); the same failure is reported in #11943, #12968, #12522, #16968 and #16984, which were answered with test skips.

  • StorageImageFormat (new core/shader/recompiler/StorageImageFormat.hpp) on ImageResource, set in AddTargetMerge: 4_4_4_4 -> R16ui, 11_11_10 and 10_11_11 -> R32ui, unclamped UNORM/SNORM blends -> the target's format (R8, RG8, RGBA8, R16, RG16, RGBA16, UNORM and SNORM). BGRA8 and any other format stay Unknown and keep today's refusal.
  • ImageType emits the concrete SPIR-V format; EmitStorageImageRead and the formatless write capability are demanded only for Unknown. Formats other than R32ui and RGBA8 need StorageImageExtendedFormats: advertised from VulkanDevice.cpp when shaderStorageImageExtendedFormats is enabled, accepted by ShaderDeviceProfile.cpp and ShaderValidation.cpp, and gated on supportedCapabilities (absent: Unknown, today's refusal).
  • The unclamped blend format comes from ExportTargetMerges (TargetMerge::storageFormat) and is part of CacheKey.hpp, the Recompiler.cpp key, DrawLookup.cpp and RequestSerializer.cpp (version 56 -> 57, older streams read as Unknown). Disk cache: encoder and decoder lines, fieldCount<ImageResource>() == 51, FormatVersion 60 -> 61.
  • Root cause of the validation findings from the prototype (VUID-VkShaderModuleCreateInfo-pCode-08737): the merge images of a draw shared one heap array variable declared with the first entry's type. DefineDescriptors now declares one variable per distinct SPIR-V format in a heap; with more than one they are Aliased on the same binding (ShaderValidation.cpp accepts aliased storage-image variables the way it accepts aliased buffer views). If the device has formatless read and write, a heap that would need more than one format is declared without a format as before, so devices that worked before see the same modules and the same validation output.
  • Tests: the shaderStorageImageReadWithoutFormat skips in PackedUnorm4444PartialWrite.cpp and UnclampedNormalizedBlend.cpp are removed; Graphics.cpp keeps the refusal for a 4_4_4_4 merge without StorageImageExtendedFormats and adds the typed case (no formatless capability, one r16ui image); ShaderDiskCache.cpp round-trips storageFormat; ShaderMemory.cpp and RequestSerializerTests.cpp cover the key, the serializer field, version 56 streams and an invalid format byte; ShaderDeviceProfile.cpp covers the new capability check. PackedFloatBlend.cpp is untouched (the skip in #16984 is not on main; this change makes that test pass on the HD 520 without a skip).
  • Debt: a fragment, docs/dev/debt/changes/agc-typed-merge-read.md, changes the libSceAgcDriver entries for 11_11_10 blending and unclamped normalized targets now describe what is left (BGRA8 and formats without a SPIR-V storage format, devices with neither feature, the aliased-variable validation warning). MSAA (shaderStorageImageMultisample) is not touched.

Known limit: a draw that merges targets of different formats on a device without formatless access (the three two-target draws of agc_driver_unclamped_normalized_blend on the HD 520) now runs, but the Khronos layer reports 2 Undefined-Value-StorageImage-FormatMismatch-ImageView warnings (not VUIDs) because it checks every element of the aliased array against each variable; every access uses the variable of its own format and the pixels match. A separate binding per format would avoid it and changes the runtime ABI (56 fixed heap bindings, placeholders, descriptor writes), which is a separate change.

Tested

Host: Intel HD Graphics 520 (Skylake GT2, Mesa 26.2.5 ANV, shaderStorageImageReadWithoutFormat false) and llvmpipe (LLVM 23.1.3), Linux. Windows and macOS not tested. No title run. Control = main built at b6b443106e (binaries kept apart), change = this branch rebased on 4ab649f4d8 with no conflicts (the rebase touched Recompiler.hpp, ShaderDiskCache.cpp and tests outside this diff's hunks).

Validation layer: Khronos 1.4.363 extracted without root from the Arch extra package, SHA-256 904f4eba2e708c9c96579900688a284309cd56dc09b5af3f78c563ffda13df9e checked against /var/lib/pacman/sync/extra.db; VK_LOADER_DEBUG=layer shows Inserted device layer "VK_LAYER_KHRONOS_validation" and no was not found but was requested line in any log.

VK_LAYER_PATH=<x>/usr/share/vulkan/explicit_layer.d LD_LIBRARY_PATH=<x>/usr/lib VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
ANYPS5_GPU=<Intel|llvmpipe> ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 \
ctest --test-dir build -V -R '^(agc_driver_packed_float_blend|agc_driver_packed_unorm4444_partial_write|agc_driver_unclamped_normalized_blend|agc_driver_graphics|agc_shader_disk_cache|request_serializer|agc_shader_memory)$'
Test HD 520 main HD 520 change llvmpipe main llvmpipe change
agc_driver_packed_float_blend Failed (formatless read refused) Passed Passed Passed
agc_driver_packed_unorm4444_partial_write Skipped (no formatless read) Passed Passed Passed
agc_driver_unclamped_normalized_blend Skipped (no formatless read) Passed (14 UNORM, 4 SNORM, 2 overdraws, 3 two-target draws) Passed Passed
agc_driver_graphics Passed Passed Passed Passed
agc_shader_disk_cache Passed Passed Passed Passed
request_serializer Passed Passed Passed Passed
agc_shader_memory Passed Passed Passed Passed

VUID- lines in the logs: 0 on main and 0 on the change, on both GPUs. Other validation messages: llvmpipe main and change both log 30 Undefined-Value-ShaderOutputNotConsumed-DynamicRendering; HD 520 change logs the same 30 and the 2 FormatMismatch warnings above (main's HD 520 run refuses or skips these tests, so it logs none).

Sweep on the HD 520 (ANYPS5_GPU=Intel ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^agc_driver_' -j1 --timeout 90, no validation layer): main b6b443106e 1038 tests, 11 failed, 33 skipped; change (branch on 4b37092bef, before the last rebase) 1039 tests, 9 failed, 31 skipped. Fixed: agc_driver_packed_float_blend (failed), agc_driver_packed_unorm4444_partial_write and agc_driver_unclamped_normalized_blend (skipped). New failures: none. The 9 remaining failures are the same on main: f32_denormal_flush, f64_rounding_denormal_modes, image_sample_lod_clamp, sample_multisample_target, native_color_initial_nonuniform (+ _lifetime, _capabilities, _hook), and guest_memory_lifetime_converted (its libGuestMemoryFixture.prx target is not built in this tree). agc_driver_unsupported_diagnostics failed in the first control sweep only because of how the control binaries were relocated and passes on main when rerun.

After main took request serialization version 56 (c7078a8762, wave-shared VGPR words), main 1086833f9a was merged into this branch (404a564341, no rebase, so b9596591da stays in the history): this change's storageFormat byte moved to version 57, the reader keeps main's version-56 gate for the compute VGPR words, RequestSerializerTests.cpp keeps main's version 55 and 56 replays and adds the same replays for graphics streams (ba45036777). The seven tests above were rerun at ba45036777's parent with the validation layer: 7/7 pass on the HD 520 and on llvmpipe, 0 VUID- lines; request_serializer passes at ba45036777.

After main took disk cache format 60 (74407aac46), main 9fabd4aa7e was merged in again (2b83ae06fc, no rebase): FormatVersion is now 61 and the request serializer stays at 57 (main is still at 56). The seven tests above were rerun at 2b83ae06fc with the validation layer: 7/7 pass on the HD 520 and on llvmpipe, 0 VUID- lines, and the same 30 ShaderOutputNotConsumed warnings on both plus the 2 FormatMismatch warnings on the HD 520.

After main took disk cache format 68 (merged main at 32b292ba38, merge commit e91dcedb0b), the shader disk cache FormatVersion is 69, one above main's 68. main's request serializer is still at 56, so this PR's serializer stays at 57, and the ImageResource field count assert stays at 51. The merge was a plain merge, not a rebase, with ShaderDiskCache.hpp the only conflict. I reran the seven tests (agc_driver_packed_float_blend, agc_driver_packed_unorm4444_partial_write, agc_driver_unclamped_normalized_blend, agc_driver_graphics, agc_shader_disk_cache, request_serializer, agc_shader_memory) with the Khronos validation layer, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1 on the Intel HD 520 and on llvmpipe: all seven pass on both, with no VUID- errors, 30 ShaderOutputNotConsumed on both and 2 FormatMismatch on the HD 520 only.

Latest sync: main 43fccc9323, then 41fbfacd01, merged in (a4c787c7ad, no rebase). main is at request version 63 and disk cache format 95, so this PR uses request version 64 and FormatVersion 96. main's version 62 barycentric fixture now strips the merge storage byte this PR writes (69c5cdb01a, test only). The debt changes moved to the fragment above. A second sync with main 41fbfacd01 (24a4b065c1) kept the same version numbers, since main did not bump them, and moved main's new VerifySingleSampleVersion63 test to version 64 (1a8d2dfaa4). The eight tests (the seven above plus public_headers) pass on the HD 520 and llvmpipe with the validation layer and no VUID- lines.

Other devices: On Raptor Lake under Windows (no shaderStorageImageReadWithoutFormat, with extended formats and pixel interlock), @androidbaklava ran head 1a8d2dfaa4 merged onto main 56d4f9fe7e on a UHD Graphics 8086:a7a8 with driver 101.7084. The three blend tests, which main skips, passed every run, 210 PR runs in all with and without the validation layer and with all seven tests run in parallel, and logged 0 VUID- lines (comment). On an 8086:A78B with the older driver 31.0.101.5081, @mihiii1337 saw packed_float_blend and packed_unorm4444_partial_write fail intermittently. The packed_float_color_target control fails on main there too, so the failures track that driver (comment). A follow-up on the same build alternated the ordinary path with APS5_NO_GPL=1: packed_float_blend and the plain packed_float_color_target control each failed 3 of 3 with the graphics pipeline library and passed 3 of 3 without it, with no VUID- lines, which ties both to the separate pipeline library problem on that driver (#25697) (comment). After updating that GPU to driver 32.0.101.6127, the same binaries passed all four packed tests 3 of 3 with the pipeline library enabled, with and without APS5_NO_BARRIER_BATCH=1, with no VUID- lines (comment). @GiannisG1 ran head b9596591da merged onto main 105c9e4d91 (Linux Mint 22.3, GCC 13.3.0, Release, Xvfb; "masked" = Khronos profiles layer 1.3.275 reporting shaderStorageImageReadWithoutFormat false): Intel HD Graphics 630 (Mesa 25.2.8 ANV, false natively) goes from packed_float_blend failed and the other two skipped to 7/7 passing; GTX 1050 Ti (580.178.04) and llvmpipe pass 7/7 on both sides, and with the read masked both go from the same failure and skips to 7/7. Full suite: 4538 tests on the GTX and the 1149 GPU tests on the HD 630 and llvmpipe, with the three tests above on the HD 630 as the only changed results. Validation layer 1.3.275 logs the same 3 VUID-VkDeviceCreateInfo-pNext-pNext on main and this PR (GTX, llvmpipe) and prints no warnings, so it does not show the two FormatMismatch warnings (comment).

python3 tools/check_conventions.py --base origin/main: 0 errors, 2 debt-length warnings (the two debt entries were already over 1000 characters).

Overlap

tools/pr_overlap.py lists 104 open pull requests that share files, none implementing typed storage-image reads for merges. The relevant shared lines are the serializer and disk cache version numbers (RequestSerializer.cpp 56 -> 57, FormatVersion 69): #10359, #11483 and #15343 also edit the serializer and #14944 and #16260 the disk cache, so whichever lands second renumbers. #16984 (skip for agc_driver_packed_float_blend) becomes unnecessary on devices with shaderStorageImageExtendedFormats; if it merges first this change drops its skips.

After main took request serialization version 57 (tail fields maxImageArrayLayers and fixedPushSlots) and disk cache format 69, main 37646cd2ca was merged into this branch (merge commit 9d7f18fbce, no rebase). This change's storageFormat byte moves to serialization version 58, the reader gates it at version 58 and RequestSerializerTests.cpp and ShaderMemory.cpp take main's version 56 and 57 replays, with their version 56 helper now removing the storage byte so its streams stay valid version 56. The shader disk cache FormatVersion is 70, one above main's 69, and the ImageResource field count assert is 52 (main's new field plus this one). I reran the seven tests (agc_driver_packed_float_blend, agc_driver_packed_unorm4444_partial_write, agc_driver_unclamped_normalized_blend, agc_driver_graphics, agc_shader_disk_cache, request_serializer, agc_shader_memory) with the Khronos validation layer, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1 on the Intel HD 520 and on llvmpipe: no VUID- errors on either, all seven pass on llvmpipe, and on the HD 520 six pass and agc_driver_packed_float_blend skips because main now skips it without shaderStorageImageReadWithoutFormat (the skip merged unchanged). public_headers and tools/check_conventions.py --base origin/main pass.

The packed float blend test no longer skips without shaderStorageImageReadWithoutFormat. Main commit 3c6c68bf5b made agc_driver_packed_float_blend return a skip on devices lacking that feature, because its merge shader read the color target without a format. With typed storage image reads for color-target merges the feature is not needed, so the skip is removed in a877caf5c2 (the overdraw benchmark keeps only its pixel interlock guard), as already done for the packed unorm4444 and unclamped normalized blend tests. On an Intel HD 520 the test passes in three runs and on llvmpipe once, with no VUID- errors under the Khronos validation layer, and the same test on main with the skip removed fails there with "storage image reads without a format are unavailable on the target device".

Merged main at 1af270fa29 (b52d39b252): request serialization is renumbered to version 63 after main's 62, accepted beside main's refusals of 58 to 61, with the storage format byte read from version 63; ShaderDiskCache::FormatVersion is 89 and the ImageResource field count is 52. The legacy fixtures in ShaderMemory.cpp and RequestSerializerTests.cpp start from version 63 (prefix NVNQQT8AAAA=) and trim 6 trailing bytes to reach version 56. The per-format storage image variables now follow main's 64-bit image atomic lock rule. The blend, graphics, disk cache, request serializer and shader memory tests pass on Intel HD 520 and llvmpipe with the validation layer inserted and no VUID- errors.

Merged main 3c07e1d05e (merge commit 207866fb41). ShaderDiskCache::FormatVersion is 91, one above main's 90; the recompile request serialization version stays 63 because main is still at 62. Rerun with the Khronos validation layer on an Intel HD 520 and on llvmpipe: the request serializer, public header, packed float blend, packed unorm4444 partial write, unclamped normalized blend, graphics, shader disk cache and shader memory tests pass on both with no VUID- errors.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Intel HD Graphics 520 (ANV, Mesa 26.2.5), llvmpipe
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5209992429 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17056). Originally posted by [sherySJ](https://github.com/sherySJ) on 2026-11-08T08:50:26Z. --- ### What Pixel-shader color-target merges read the merge image through a storage image declared with the target's format instead of a formatless one, so they run on GPUs without `shaderStorageImageReadWithoutFormat` (Intel Gen9 to Gen12.0 on Linux ANV and on the Windows Intel driver: HD 520/530/620/630, Ice Lake, Tiger Lake, Alder/Raptor Lake UHD 7xx). Until now `EmitStorageImageRead` refused every merge draw there (`storage image reads without a format are unavailable on the target device`); the same failure is reported in #11943, #12968, #12522, #16968 and #16984, which were answered with test skips. - `StorageImageFormat` (new `core/shader/recompiler/StorageImageFormat.hpp`) on `ImageResource`, set in `AddTargetMerge`: 4_4_4_4 -> `R16ui`, 11_11_10 and 10_11_11 -> `R32ui`, unclamped UNORM/SNORM blends -> the target's format (R8, RG8, RGBA8, R16, RG16, RGBA16, UNORM and SNORM). BGRA8 and any other format stay `Unknown` and keep today's refusal. - `ImageType` emits the concrete SPIR-V format; `EmitStorageImageRead` and the formatless write capability are demanded only for `Unknown`. Formats other than `R32ui` and RGBA8 need `StorageImageExtendedFormats`: advertised from `VulkanDevice.cpp` when `shaderStorageImageExtendedFormats` is enabled, accepted by `ShaderDeviceProfile.cpp` and `ShaderValidation.cpp`, and gated on `supportedCapabilities` (absent: `Unknown`, today's refusal). - The unclamped blend format comes from `ExportTargetMerges` (`TargetMerge::storageFormat`) and is part of `CacheKey.hpp`, the `Recompiler.cpp` key, `DrawLookup.cpp` and `RequestSerializer.cpp` (version 56 -> 57, older streams read as `Unknown`). Disk cache: encoder and decoder lines, `fieldCount<ImageResource>() == 51`, `FormatVersion` 60 -> 61. - Root cause of the validation findings from the prototype (`VUID-VkShaderModuleCreateInfo-pCode-08737`): the merge images of a draw shared one heap array variable declared with the first entry's type. `DefineDescriptors` now declares one variable per distinct SPIR-V format in a heap; with more than one they are `Aliased` on the same binding (`ShaderValidation.cpp` accepts aliased storage-image variables the way it accepts aliased buffer views). If the device has formatless read and write, a heap that would need more than one format is declared without a format as before, so devices that worked before see the same modules and the same validation output. - Tests: the `shaderStorageImageReadWithoutFormat` skips in `PackedUnorm4444PartialWrite.cpp` and `UnclampedNormalizedBlend.cpp` are removed; `Graphics.cpp` keeps the refusal for a 4_4_4_4 merge without `StorageImageExtendedFormats` and adds the typed case (no formatless capability, one `r16ui` image); `ShaderDiskCache.cpp` round-trips `storageFormat`; `ShaderMemory.cpp` and `RequestSerializerTests.cpp` cover the key, the serializer field, version 56 streams and an invalid format byte; `ShaderDeviceProfile.cpp` covers the new capability check. `PackedFloatBlend.cpp` is untouched (the skip in #16984 is not on `main`; this change makes that test pass on the HD 520 without a skip). - Debt: a fragment, `docs/dev/debt/changes/agc-typed-merge-read.md`, changes the `libSceAgcDriver` entries for 11_11_10 blending and unclamped normalized targets now describe what is left (BGRA8 and formats without a SPIR-V storage format, devices with neither feature, the aliased-variable validation warning). MSAA (`shaderStorageImageMultisample`) is not touched. Known limit: a draw that merges targets of different formats on a device without formatless access (the three two-target draws of `agc_driver_unclamped_normalized_blend` on the HD 520) now runs, but the Khronos layer reports 2 `Undefined-Value-StorageImage-FormatMismatch-ImageView` warnings (not VUIDs) because it checks every element of the aliased array against each variable; every access uses the variable of its own format and the pixels match. A separate binding per format would avoid it and changes the runtime ABI (56 fixed heap bindings, placeholders, descriptor writes), which is a separate change. ### Tested Host: Intel HD Graphics 520 (Skylake GT2, Mesa 26.2.5 ANV, `shaderStorageImageReadWithoutFormat` false) and llvmpipe (LLVM 23.1.3), Linux. Windows and macOS not tested. No title run. Control = `main` built at b6b443106e (binaries kept apart), change = this branch rebased on 4ab649f4d8 with no conflicts (the rebase touched `Recompiler.hpp`, `ShaderDiskCache.cpp` and tests outside this diff's hunks). Validation layer: Khronos 1.4.363 extracted without root from the Arch `extra` package, SHA-256 904f4eba2e708c9c96579900688a284309cd56dc09b5af3f78c563ffda13df9e checked against `/var/lib/pacman/sync/extra.db`; `VK_LOADER_DEBUG=layer` shows `Inserted device layer "VK_LAYER_KHRONOS_validation"` and no `was not found but was requested` line in any log. ``` VK_LAYER_PATH=<x>/usr/share/vulkan/explicit_layer.d LD_LIBRARY_PATH=<x>/usr/lib VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \ ANYPS5_GPU=<Intel|llvmpipe> ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 \ ctest --test-dir build -V -R '^(agc_driver_packed_float_blend|agc_driver_packed_unorm4444_partial_write|agc_driver_unclamped_normalized_blend|agc_driver_graphics|agc_shader_disk_cache|request_serializer|agc_shader_memory)$' ``` | Test | HD 520 main | HD 520 change | llvmpipe main | llvmpipe change | |---|---|---|---|---| | `agc_driver_packed_float_blend` | Failed (formatless read refused) | Passed | Passed | Passed | | `agc_driver_packed_unorm4444_partial_write` | Skipped (no formatless read) | Passed | Passed | Passed | | `agc_driver_unclamped_normalized_blend` | Skipped (no formatless read) | Passed (14 UNORM, 4 SNORM, 2 overdraws, 3 two-target draws) | Passed | Passed | | `agc_driver_graphics` | Passed | Passed | Passed | Passed | | `agc_shader_disk_cache` | Passed | Passed | Passed | Passed | | `request_serializer` | Passed | Passed | Passed | Passed | | `agc_shader_memory` | Passed | Passed | Passed | Passed | `VUID-` lines in the logs: 0 on main and 0 on the change, on both GPUs. Other validation messages: llvmpipe main and change both log 30 `Undefined-Value-ShaderOutputNotConsumed-DynamicRendering`; HD 520 change logs the same 30 and the 2 `FormatMismatch` warnings above (main's HD 520 run refuses or skips these tests, so it logs none). Sweep on the HD 520 (`ANYPS5_GPU=Intel ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^agc_driver_' -j1 --timeout 90`, no validation layer): main b6b443106e 1038 tests, 11 failed, 33 skipped; change (branch on 4b37092befb, before the last rebase) 1039 tests, 9 failed, 31 skipped. Fixed: `agc_driver_packed_float_blend` (failed), `agc_driver_packed_unorm4444_partial_write` and `agc_driver_unclamped_normalized_blend` (skipped). New failures: none. The 9 remaining failures are the same on main: `f32_denormal_flush`, `f64_rounding_denormal_modes`, `image_sample_lod_clamp`, `sample_multisample_target`, `native_color_initial_nonuniform` (+ `_lifetime`, `_capabilities`, `_hook`), and `guest_memory_lifetime_converted` (its `libGuestMemoryFixture.prx` target is not built in this tree). `agc_driver_unsupported_diagnostics` failed in the first control sweep only because of how the control binaries were relocated and passes on main when rerun. After `main` took request serialization version 56 (c7078a8762, wave-shared VGPR words), `main` 1086833f9a was merged into this branch (404a564341, no rebase, so `b9596591da` stays in the history): this change's `storageFormat` byte moved to version 57, the reader keeps `main`'s version-56 gate for the compute VGPR words, `RequestSerializerTests.cpp` keeps `main`'s version 55 and 56 replays and adds the same replays for graphics streams (ba45036777). The seven tests above were rerun at ba45036777's parent with the validation layer: 7/7 pass on the HD 520 and on llvmpipe, 0 `VUID-` lines; `request_serializer` passes at ba45036777. After `main` took disk cache format 60 (74407aac46), `main` 9fabd4aa7e was merged in again (2b83ae06fc, no rebase): `FormatVersion` is now 61 and the request serializer stays at 57 (`main` is still at 56). The seven tests above were rerun at 2b83ae06fc with the validation layer: 7/7 pass on the HD 520 and on llvmpipe, 0 `VUID-` lines, and the same 30 `ShaderOutputNotConsumed` warnings on both plus the 2 `FormatMismatch` warnings on the HD 520. After `main` took disk cache format 68 (merged `main` at 32b292ba38, merge commit e91dcedb0b), the shader disk cache `FormatVersion` is 69, one above `main`'s 68. `main`'s request serializer is still at 56, so this PR's serializer stays at 57, and the `ImageResource` field count assert stays at 51. The merge was a plain merge, not a rebase, with `ShaderDiskCache.hpp` the only conflict. I reran the seven tests (`agc_driver_packed_float_blend`, `agc_driver_packed_unorm4444_partial_write`, `agc_driver_unclamped_normalized_blend`, `agc_driver_graphics`, `agc_shader_disk_cache`, `request_serializer`, `agc_shader_memory`) with the Khronos validation layer, `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1` on the Intel HD 520 and on llvmpipe: all seven pass on both, with no `VUID-` errors, 30 `ShaderOutputNotConsumed` on both and 2 `FormatMismatch` on the HD 520 only. Latest sync: `main` 43fccc9323, then 41fbfacd01, merged in (a4c787c7ad, no rebase). `main` is at request version 63 and disk cache format 95, so this PR uses request version 64 and `FormatVersion` 96. `main`'s version 62 barycentric fixture now strips the merge storage byte this PR writes (69c5cdb01a, test only). The debt changes moved to the fragment above. A second sync with `main` 41fbfacd01 (24a4b065c1) kept the same version numbers, since `main` did not bump them, and moved `main`'s new `VerifySingleSampleVersion63` test to version 64 (1a8d2dfaa4). The eight tests (the seven above plus `public_headers`) pass on the HD 520 and llvmpipe with the validation layer and no `VUID-` lines. Other devices: On Raptor Lake under Windows (no `shaderStorageImageReadWithoutFormat`, with extended formats and pixel interlock), @androidbaklava ran head `1a8d2dfaa4` merged onto `main` `56d4f9fe7e` on a UHD Graphics `8086:a7a8` with driver 101.7084. The three blend tests, which `main` skips, passed every run, 210 PR runs in all with and without the validation layer and with all seven tests run in parallel, and logged 0 `VUID-` lines ([comment](https://github.com/boykopovar/AnyPS5/pull/17056#issuecomment-7065355115)). On an `8086:A78B` with the older driver 31.0.101.5081, @mihiii1337 saw `packed_float_blend` and `packed_unorm4444_partial_write` fail intermittently. The `packed_float_color_target` control fails on `main` there too, so the failures track that driver ([comment](https://github.com/boykopovar/AnyPS5/pull/17056#issuecomment-7064666507)). A follow-up on the same build alternated the ordinary path with `APS5_NO_GPL=1`: `packed_float_blend` and the plain `packed_float_color_target` control each failed 3 of 3 with the graphics pipeline library and passed 3 of 3 without it, with no `VUID-` lines, which ties both to the separate pipeline library problem on that driver (#25697) ([comment](https://github.com/boykopovar/AnyPS5/pull/17056#issuecomment-7083026182)). After updating that GPU to driver 32.0.101.6127, the same binaries passed all four packed tests 3 of 3 with the pipeline library enabled, with and without `APS5_NO_BARRIER_BATCH=1`, with no `VUID-` lines ([comment](https://github.com/boykopovar/AnyPS5/pull/17056#issuecomment-7088850520)). @GiannisG1 ran head `b9596591da` merged onto `main` `105c9e4d91` (Linux Mint 22.3, GCC 13.3.0, Release, Xvfb; "masked" = Khronos profiles layer 1.3.275 reporting `shaderStorageImageReadWithoutFormat` false): Intel HD Graphics 630 (Mesa 25.2.8 ANV, false natively) goes from `packed_float_blend` failed and the other two skipped to 7/7 passing; GTX 1050 Ti (580.178.04) and llvmpipe pass 7/7 on both sides, and with the read masked both go from the same failure and skips to 7/7. Full suite: 4538 tests on the GTX and the 1149 GPU tests on the HD 630 and llvmpipe, with the three tests above on the HD 630 as the only changed results. Validation layer 1.3.275 logs the same 3 `VUID-VkDeviceCreateInfo-pNext-pNext` on `main` and this PR (GTX, llvmpipe) and prints no warnings, so it does not show the two `FormatMismatch` warnings ([comment](https://github.com/boykopovar/AnyPS5/pull/17056#issuecomment-6721902444)). `python3 tools/check_conventions.py --base origin/main`: 0 errors, 2 `debt-length` warnings (the two debt entries were already over 1000 characters). ### Overlap `tools/pr_overlap.py` lists 104 open pull requests that share files, none implementing typed storage-image reads for merges. The relevant shared lines are the serializer and disk cache version numbers (`RequestSerializer.cpp` 56 -> 57, `FormatVersion` 69): #10359, #11483 and #15343 also edit the serializer and #14944 and #16260 the disk cache, so whichever lands second renumbers. #16984 (skip for `agc_driver_packed_float_blend`) becomes unnecessary on devices with `shaderStorageImageExtendedFormats`; if it merges first this change drops its skips. After `main` took request serialization version 57 (tail fields maxImageArrayLayers and fixedPushSlots) and disk cache format 69, `main` 37646cd2ca was merged into this branch (merge commit 9d7f18fbce, no rebase). This change's `storageFormat` byte moves to serialization version 58, the reader gates it at version 58 and `RequestSerializerTests.cpp` and `ShaderMemory.cpp` take `main`'s version 56 and 57 replays, with their version 56 helper now removing the storage byte so its streams stay valid version 56. The shader disk cache `FormatVersion` is 70, one above `main`'s 69, and the `ImageResource` field count assert is 52 (`main`'s new field plus this one). I reran the seven tests (`agc_driver_packed_float_blend`, `agc_driver_packed_unorm4444_partial_write`, `agc_driver_unclamped_normalized_blend`, `agc_driver_graphics`, `agc_shader_disk_cache`, `request_serializer`, `agc_shader_memory`) with the Khronos validation layer, `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1` on the Intel HD 520 and on llvmpipe: no `VUID-` errors on either, all seven pass on llvmpipe, and on the HD 520 six pass and `agc_driver_packed_float_blend` skips because `main` now skips it without `shaderStorageImageReadWithoutFormat` (the skip merged unchanged). `public_headers` and `tools/check_conventions.py --base origin/main` pass. The packed float blend test no longer skips without `shaderStorageImageReadWithoutFormat`. Main commit 3c6c68bf5b made `agc_driver_packed_float_blend` return a skip on devices lacking that feature, because its merge shader read the color target without a format. With typed storage image reads for color-target merges the feature is not needed, so the skip is removed in a877caf5c2 (the overdraw benchmark keeps only its pixel interlock guard), as already done for the packed unorm4444 and unclamped normalized blend tests. On an Intel HD 520 the test passes in three runs and on llvmpipe once, with no VUID- errors under the Khronos validation layer, and the same test on main with the skip removed fails there with "storage image reads without a format are unavailable on the target device". Merged main at 1af270fa29 (b52d39b252): request serialization is renumbered to version 63 after main's 62, accepted beside main's refusals of 58 to 61, with the storage format byte read from version 63; ShaderDiskCache::FormatVersion is 89 and the ImageResource field count is 52. The legacy fixtures in ShaderMemory.cpp and RequestSerializerTests.cpp start from version 63 (prefix `NVNQQT8AAAA=`) and trim 6 trailing bytes to reach version 56. The per-format storage image variables now follow main's 64-bit image atomic lock rule. The blend, graphics, disk cache, request serializer and shader memory tests pass on Intel HD 520 and llvmpipe with the validation layer inserted and no VUID- errors. Merged main 3c07e1d05e (merge commit 207866fb41). `ShaderDiskCache::FormatVersion` is 91, one above main's 90; the recompile request serialization version stays 63 because main is still at 62. Rerun with the Khronos validation layer on an Intel HD 520 and on llvmpipe: the request serializer, public header, packed float blend, packed unorm4444 partial write, unclamped normalized blend, graphics, shader disk cache and shader memory tests pass on both with no VUID- errors. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: Intel HD Graphics 520 (ANV, Mesa 26.2.5), llvmpipe - [x] AI-assisted: yes
MarcZX10 commented 2026-11-20 12:16:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T12:16:16Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing in the inspected code blocks merging; the remaining uncertainty is limited to changed files whose complete text was excluded from the review bundle.

What I ran

Reviewed head 69c5cdb01af08c04bf048c26754356dcd439fbac using the prepared diff and repo_read.py source reads. No commands or tests were run by me; test results below are author reported.

Results

Check Result Note
Diff and targeted source review passed Typed image format flow inspected
Tests and validation not run Author reports passing targeted tests
Full review coverage not run Three changed files excluded by size

Findings

Blocking

None in the code inspected.

Non-blocking

None.

Not verified

Full text of VulkanDevice.cpp, Graphics.cpp, and ShaderMemory.cpp was excluded as too large for the review folder, so I did not verify those files. Other changed files were listed as included; targeted source reads covered the descriptor format selection and emit paths. I did not run tests or independently confirm the author-reported results.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5992502500 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17056#pullrequestreview-5992502500). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T12:16:16Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing in the inspected code blocks merging; the remaining uncertainty is limited to changed files whose complete text was excluded from the review bundle. ## What I ran Reviewed head `69c5cdb01af08c04bf048c26754356dcd439fbac` using the prepared diff and `repo_read.py` source reads. No commands or tests were run by me; test results below are author reported. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Typed image format flow inspected | | Tests and validation | not run | Author reports passing targeted tests | | Full review coverage | not run | Three changed files excluded by size | ## Findings ### Blocking None in the code inspected. ### Non-blocking None. ## Not verified Full text of `VulkanDevice.cpp`, `Graphics.cpp`, and `ShaderMemory.cpp` was excluded as too large for the review folder, so I did not verify those files. Other changed files were listed as included; targeted source reads covered the descriptor format selection and emit paths. I did not run tests or independently confirm the author-reported results. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-21 03:33:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T03:33:57Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the reported targeted tests pass, with two documented format-mismatch warnings for mixed-format MRT draws.

What I ran

Reviewed head 1a8d2dfaa4c4f17637a2ac4203b6cab6da9879e8 using repo_read.py-backed review tools. I did not run tests or build commands; the results below are author-reported. Read description.md, commits.md, manifest.json, diff.patch, and the changed source and test files listed below. VulkanDevice.cpp, Graphics.cpp, and ShaderMemory.cpp were read through the pinned reader because their full text was excluded from the review folder.

Results

Check Result Note
Targeted tests not run Author reports they pass on HD 520 and llvmpipe
Validation layer not run Author reports no VUID errors; two mixed-format warnings on HD 520
Convention check not run Author reports zero errors and two debt-length warnings

Findings

Blocking

None.

Non-blocking

  • The author reports two Undefined-Value-StorageImage-FormatMismatch-ImageView validation warnings on mixed-format MRT draws. They explain that each access uses its matching typed variable and report matching pixels. Track the warning or eliminate it in a follow-up if clean validation output is required.

Not verified

I did not run builds, tests, convention checks, or validation-layer checks. Windows, macOS, and physical-console behavior were not tested in the reported runs. files.json was not available as a review document; the reader’s file listing showed all changed paths and identified VulkanDevice.cpp, Graphics.cpp, and ShaderMemory.cpp as excluded from the review folder due to size. I read the relevant changed ranges of those files through the pinned reader. The remaining full contents of those three files were not read. No other changed file was excluded from the review folder.

To get this to a good state

Nothing is required. The validation warnings above are optional follow-up feedback.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002593787 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17056#pullrequestreview-6002593787). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T03:33:57Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the reported targeted tests pass, with two documented format-mismatch warnings for mixed-format MRT draws. ## What I ran Reviewed head `1a8d2dfaa4c4f17637a2ac4203b6cab6da9879e8` using `repo_read.py`-backed review tools. I did not run tests or build commands; the results below are author-reported. Read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, and the changed source and test files listed below. `VulkanDevice.cpp`, `Graphics.cpp`, and `ShaderMemory.cpp` were read through the pinned reader because their full text was excluded from the review folder. ## Results | Check | Result | Note | |---|---|---| | Targeted tests | not run | Author reports they pass on HD 520 and llvmpipe | | Validation layer | not run | Author reports no VUID errors; two mixed-format warnings on HD 520 | | Convention check | not run | Author reports zero errors and two debt-length warnings | ## Findings ### Blocking None. ### Non-blocking - The author reports two `Undefined-Value-StorageImage-FormatMismatch-ImageView` validation warnings on mixed-format MRT draws. They explain that each access uses its matching typed variable and report matching pixels. Track the warning or eliminate it in a follow-up if clean validation output is required. ## Not verified I did not run builds, tests, convention checks, or validation-layer checks. Windows, macOS, and physical-console behavior were not tested in the reported runs. `files.json` was not available as a review document; the reader’s file listing showed all changed paths and identified `VulkanDevice.cpp`, `Graphics.cpp`, and `ShaderMemory.cpp` as excluded from the review folder due to size. I read the relevant changed ranges of those files through the pinned reader. The remaining full contents of those three files were not read. No other changed file was excluded from the review folder. ## To get this to a good state Nothing is required. The validation warnings above are optional follow-up feedback.
ligmaSec commented 2026-12-03 22:36:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:36:04Z.

Review: COMMENTED


I compiled the exact request serializer. It round-trips a typed color-target merge using version 64. Both main c1601e56d5 and this head reject the other’s version 64 capture, and the same is true with the mesh-compute layout in #17611. Please reconcile the serializer version and preserve historical main captures when rebasing the local conflicts in shader resources, disk cache, and request tests. The native checks covered format compatibility. I have no Intel GPU result.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179823252 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17056#pullrequestreview-6179823252). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:36:04Z. **Review:** COMMENTED --- I compiled the exact request serializer. It round-trips a typed color-target merge using version 64. Both main `c1601e56d5` and this head reject the other’s version 64 capture, and the same is true with the mesh-compute layout in #17611. Please reconcile the serializer version and preserve historical main captures when rebasing the local conflicts in shader resources, disk cache, and request tests. The native checks covered format compatibility. I have no Intel GPU result. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/17056:upstream-pr/17056'
git switch 'upstream-pr/17056'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/17056'
git switch 'upstream-pr/17056'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/17056'
git switch 'upstream-pr/17056'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/17056'
git switch 'main'
git merge --squash 'upstream-pr/17056'
git switch 'main'
git merge --ff-only 'upstream-pr/17056'
git switch 'main'
git merge 'upstream-pr/17056'
git push origin 'main'
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!17056
No description provided.