fix(shader): read a 2D MSAA T# through DIM 2D as its sample 0 #7803

Merged
thuanquang merged 1 commit from upstream-pr/7803 into main 2026-10-23 15:24:59 +00:00
thuanquang commented 2026-10-19 08:10:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-19T08:10:52Z.


What

METAL GEAR SOLID: Peace Walker (PPSA18216) stops at the opening movie's last copy (#5268). A pixel shader reads its 4-sample 1440x816 RGBA8 target through a plain DIM 2D image_sample, and the recompiler refuses the T#:

image descriptor is incompatible with the static runtime image interface: descriptor format 56 decodes to {class 1, dim 6, ...}; ... T# 02754d00 c3800000 00cbc167 e1b20fac 00000000 00700020 00000000 00000000

What RDNA returns for a DIM 2D read of a 2D MSAA T# was the open question (@mrfelek, @SandstromPL). On an RX 6700 XT (gfx1031), through HIP, it is sample 0 (measurement on #5268):

  • image_sample (implicit LOD), image_sample_lz and image_load without a mip, through a T# built like the title's (format 22), return sample 0 in 1024 of 1024 lanes on a 256x256 surface spanning 16 64 KiB blocks, where a TYPE 9 (2D) T# over the same memory matched sample 0 in only 60.
  • image_sample_l at LOD 0 to 3, through an S# with MAX_LOD 15.99 and each mip filter, returns sample 0 in 256 of 256 lanes of a 16x16 surface through a T# built the same way. With a point mip filter, the same S# at LOD 1 and 2 reads another level of a 3-level TYPE 9 T# over the same memory, so the LOD takes effect.
  • A bilinear sample blends the neighbouring pixels' sample 0 (240 of 240), never the 4-sample average.
  • image_load_mip DIM 2D with mip N returns sample N.
  • A wider run (data) gives the same for image_sample, image_sample_lz and image_load at 2, 4 and 8 samples, for formats 22, 29, 56, 60, 64, 71 and 77 in SW_64KB_R_X and the 32-bit formats in SW_64KB_Z_X. Its image_sample_l rows used an all-zero S#, which clamps the LOD to 0 (correction).
  • An 8- and 16-bit run (data) gives the same at 2, 4 and 8 samples in SW_64KB_R_X and SW_64KB_Z_X for 8_UNORM, 8_UINT, 16_UNORM, 16_UINT, 16_FLOAT, 8_8_UNORM, 8_8_UINT and 5_6_5_UNORM (8_SINT and 16_SINT at 4 samples in SW_64KB_R_X). It also measures image_sample_l at LOD 1, 2 and 3 through an S# with MAX_LOD 15.99, with a control showing that S# reads mip 1 of a TYPE 9 T#, for those texels and for 32_FLOAT and 8_8_8_8_UNORM (the title's format) in SW_64KB_R_X.
  • Measured at LOD 0 only: image_sample_l for formats 29, 60, 64, 71 and 77 and for the 32-bit formats in SW_64KB_Z_X, and implicit-LOD image_sample everywhere. 64- and 128-bit texels in SW_64KB_Z_X, and SW_64KB_S_X and SW_64KB_D_X, do not address samples on this GPU (every sample index reads the same texel), so they are not covered.

This change reads it that way:

  • Recompiler (ResourceMaterializer.cpp): a 2D MSAA T# decodes as Dim2D when the access is a direct sampled image read only through image_load without a mip and image_sample, _lz or _l (the reads cubeFaceCompatible tracks, taken for sampled images only), without a depth compare, R128, FMASK or depth-bits format. The shader then uses the existing 2D runtime mode, so sampling, filtering and LOD stay native. Storage, atomics, image tables, depth compares, gathers, bias, gradients, offsets and image_load_mip keep the existing refusal. The gate has no element-size check: the 8- and 16-bit run covers the narrower texels.
  • Driver: an Image2D binding over a 2D MSAA resource gets a one-sample copy of sample 0 (MultisampleTargetFirstSample). After the usual Sampled() checks (CMASK/HTILE, fast clears, pending storage writes, barrier), a fragment pass (FirstSampleCopy, texelFetch of sample 0 into a one-sample attachment of the target's format) refreshes the copy before each such binding. The pass reads the target's sampled view in the layout that view reports (Texture::Layout()), and creates its shader modules through CreateShaderModule, the path #6436 made for every module the driver creates. Float, UNORM, SNORM and sRGB formats go through a float pass; UINT and SINT formats go through usampler2DMS and isampler2DMS passes, which copy the bits. It works for a live target, a red/blue-swapped one, and a texture no draw rendered to (createFilled). A Vulkan resolve would not do: it averages float and UNORM samples. A multisampled depth surface read this way throws.

The debt entries state the gaps first. The reads are measured on gfx1031, not the console's gfx1013. Implicit LOD above 0, explicit LOD above 0 for texels over 16 bits other than formats 22 and 56 in SW_64KB_R_X, and other formats and swizzle modes are not measured. 64- and 128-bit SW_64KB_Z_X texels are not covered. Float, UNORM, SNORM and sRGB values pass through a shader and a color attachment, which Vulkan does not require to keep exact.

Tested

Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002 and 32.0.21045.16010, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, ANYPS5_REQUIRE_VULKAN=1. Rebased onto main 9d6adeb550: this head (0a3ea213e1) is one commit on it; the one conflict was in tests/ShaderMemory.cpp, where main added a verifyArrayVolumeStoreMode() call in main() on the line where this change adds verifyMultisamplePlaneReadMode(); both calls are kept, and the rest of the patch is unchanged. On this head, with AMD driver 32.0.21045.16010, the six focused tests below pass 3 of 3, and a validation layer run of the six (same environment as the validation layer run below) passes with no VUID- error and no was not found but was requested line. The full AGC suite on this head (ctest -R ^agc_ -j 1): 902 of 905 pass; the three failures, agc_driver_sample_order, agc_driver_sample_order_grid_reference and agc_driver_sample_order_recipe_depth_locations, fail on main on this machine as well (seen on main d6eafa54d). The rebase before it, onto 001d132f47 (head e0f6ea8ed6), had one conflict in MultisampleTarget.cpp, where #8847 (sRGB twin formats) added View(VkFormat) and Serves(), made ResolvePass() per format and destroys the twin view in release(), next to this change's FirstSample() and its two release() lines; both are kept, and with AMD driver 32.0.21045.16010 the six focused tests below passed 3 of 3 on it. The rebase before that, onto 8b3a6ba88d (head 0ad8aa3278), had one conflict: main added imageCoordinates() in ResourceMaterializer.cpp where this change adds multisamplePlaneRead(), and both are kept. main's new GCN-only address-count check runs before this change's sample-0 rule, so GCN shaders behave as on main. On that head, with AMD driver 32.0.21045.16010, the six focused tests below passed 3 of 3; with main's ResourceMaterializer.cpp on it, agc_shader_memory failed with descriptor format 56 decodes to {class 1, dim 6, ...} as below. Before that, the rebase onto 2f161d4f33 (head 9ac1a20ce4) had one conflict: main added its SampleOrder shader block in core/libs/prx/libSceAgcDriver/CMakeLists.txt where this change adds the FirstSample block, and both are kept. On that head the six focused tests below passed 3 of 3, and the validation layer run (A: main 2f161d4f33 with #9115's libSceNpTrophy2-only commit, which none of these tests load; B: 9ac1a20ce4) has no VUID- line and no was not found but was requested on either side; A has five of the six, since agc_uncounted_passes comes with this change. Before that, the rebase onto 7ab4b2e56 had one conflict too: #7966 added a depth1D check on the lines where this change adds firstSample, and both checks are kept.

  • agc_shader_memory, new verifyMultisamplePlaneReadMode: a sampled Dim2D access to the title's T# selects the float 2D runtime mode, and 2D MSAA T#s with 8- and 16-bit texels select the 2D mode of their numeric class (4x 8_UNORM and 4x 16_SINT in SW_64KB_R_X, 2x 8_UINT and 8x 16_FLOAT in SW_64KB_Z_X). A 4x 16_UINT SW_64KB_Z_X T#, which is read as depth bits, an access outside the measured set (cubeFaceCompatible false), a depth compare and a storage access are refused.
  • agc_driver_sample_multisample_target, new CheckFirstSampleReads: DIM 2D image_load, image_sample_lz and image_sample_l at LOD 1 through the 4x target's TYPE 14 T# return each pixel's sample 0, bit for bit, as the target's DIM 2D_MSAA image_load reads it. It checks every pixel of:
    • the drawn RGBA16F target, where some pixels' sample 0 differs from another of its samples, so a resolve would fail the check;
    • a BGRA8 target read through an RGBA8 T# (the red/blue swap);
    • zeroed memory no draw rendered to;
    • a drawn 4x 8_8_8_8_UINT target and 8_8_8_8_SINT color memory no draw rendered to, with negative channels, through the UINT and SINT passes. These two cases run only where sampledImageIntegerSampleCounts includes 4 samples (Vulkan requires only 1); elsewhere the test prints DIM 2D reads of 4x 8_8_8_8_UINT and 8_8_8_8_SINT targets not tested: sampledImageIntegerSampleCounts lacks VK_SAMPLE_COUNT_4_BIT and goes on. The RX 6700 XT runs them.
  • Red on main 7f596df48 with only this PR's tests: agc_shader_memory fails with descriptor format 56 decodes to {class 1, dim 6, ...}, the title's refusal, and agc_driver_sample_multisample_target with the same refusal for its RGBA16F target (format 71).
  • With only the recompiler half: agc_shader_memory passes, and the GPU test fails one step later, at the driver: guest texture dimension disagrees with the shader's declared image shape (shape 1, dimension 6).
  • Green: both pass 3 of 3 on 7f596df48, and after rebasing onto main fb0dc118f.
  • Head 5b7894778 (on main 7ab4b2e56): agc_shader_memory, agc_driver_sample_multisample_target, agc_driver_native_msaa_vertex_input, agc_driver_graphics, agc_uncounted_passes and agc_sample_dumps pass 3 of 3.
  • Head aae3228a5 (on main b85d972f4): agc_shader_memory, agc_driver_sample_multisample_target, agc_driver_native_msaa_vertex_input, agc_driver_graphics, agc_uncounted_passes and agc_sample_dumps pass 3 of 3, and once more after the controls below were restored and rebuilt.
  • Controls on aae3228a5, each built and run on its own, then restored:
    • the UINT pass reading sample 1: agc_driver_sample_multisample_target fails with a DIM 2D image_load of pixel (9, 11) read 00000000 00000000 00000000 00000000, sample 0 is 00000012 000000be 00000042 00000081 from a drawn 4x 8_8_8_8_UINT target;
    • the SINT pass writing its channels in reverse order: it fails with a DIM 2D image_load of pixel (0, 0) read ffffff81 ffffffbe ffffffff 00000012, sample 0 is 00000012 ffffffff ffffffbe ffffff81 from 8_8_8_8_SINT color memory no draw rendered to;
    • RGBA8 UINT and SINT taken through the float pass: the test passes on this driver, which copies those bits through the float pass. Only the validation layer catches it: VUID-vkCmdDraw-format-07753 (the view's numeric type must match the shader's sampled type), reported 10 times, the layer's default limit for one message, and 2 Undefined-Value-ShaderFragmentOutputMismatch warnings;
    • an element-size check in the gate (GetFormatInfo(format).byteSize >= 4u): agc_shader_memory fails at the 8_UNORM row with descriptor format 1 decodes to {class 1, dim 6, ...};
    • the gate without its depth-bits check: agc_shader_memory fails with a 2D read of a 16_UINT SW_64KB_Z_X 2D MSAA T#, read as depth bits, was accepted;
    • the integer cases' device check forced to report no 4-sample integer sampling: the test prints the line above, skips only those two cases, runs the rest and passes.
  • On an earlier head (e7ab9e7c1 on main fb0dc118f), the full ctest --parallel 4 --timeout 120: 1605 tests, 9 fail, none of which reads a multisampled texture:
    • the three AMD failures main has here (agc_driver_lds_mixed_width_atomics #6976, agc_driver_lds_lock_budget #7344, agc_driver_layered_volume_vertex_no_gpl #4768);
    • agc_trimmed_import, the new test from #6499, which fails the same way on main on this machine;
    • agc_driver_draw_cache_reuse_off and agc_driver_stencil_replay_no_gpl, which lose the device under their usual names and pass from renamed copies (AMD's per-executable pipeline cache, as in #4768);
    • guest_nanosleep_timer_self_test, a timing test, which timed out while other builds were running;
    • log_macros and log_macros_timestamps, which fail only in this local build because ccache's base directory turns __FILE__ into a relative path with backslashes.
  • Khronos validation layer (vulkan-sdk-1.4.363.0), VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V, same RX 6700 XT, on main 7ab4b2e56 and on 5b7894778, this change rebased onto it. agc_shader_memory, agc_driver_sample_multisample_target, agc_driver_native_msaa_vertex_input, agc_driver_graphics and agc_sample_dumps pass on both, and the new agc_uncounted_passes passes on 5b7894778 (6 of 6). Neither log has a was not found but was requested line or a VUID- error. The same environment reports the float-pass control above, so the layer was loaded.
  • python tools/check_conventions.py --base origin/main with this title and body passes.
  • In the title (@mrfelek, Linux, RTX 3080 Ti, main + #6842 + this PR at b216fe3a3): Peace Walker gets past the read main refuses, starts mgspw and reaches the title screen, with no image descriptor is incompatible in the log and no abort in 9 minutes on the title screen and its attract movies. Whether the picture at the copy matches a resolve was not compared.
  • With #8871 (@mrfelek, Linux, RTX 3080 Ti, main cecb540a6 + this PR 9ac1a20ce + #8871 593f4ab86, without local changes): Peace Walker plays through New Game into the beach tutorial at about 60 FPS, with no driver error in the log.
  • Apple M2 Max on MoltenVK (@jotitadev, head b216fe3a3 with the storage-multisampling gate moved below the sample-0 checks locally): the sample-0 and BGRA8 checks pass, and fail with the recompiler change reverted. MoltenVK has no shaderStorageImageMultisample. The gate has sat there since 09c3d719f, so devices without storage multisampling run those checks and skip only the fill, store and swizzle cases. The UINT and SINT cases are newer than that run.
  • Linux, RX 9070 XT on RADV (@blawesom, their rebase 7ecc1293f of head b216fe3a3): the full suite has no failures from this PR.
  • Linux, NVIDIA RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), head 9ac1a20ce on main a6dcea927 (@jotitadev): agc_driver_sample_multisample_target fails on both with ShaderResources.cpp and ResourceMaterializer.cpp reverted (image descriptor is incompatible with the static runtime image interface, the DIM 6 T#) and passes with this PR; lavapipe runs the multisampled storage-image path that MoltenVK skips. agc_uncounted_passes passes on both, and the rest of the ^agc suite matches main (NVIDIA 859/862, lavapipe 861/862, only failures main already has there).
  • Not tested: the console (gfx1013).

From the reviews of this change:

  • The copy pass is recorded through a new Recorder::RecordUncounted. When the recorder counts occlusion over a whole batch (the fallback without segment queries), it ends that query around the copy and starts a new one, and the batch's sample count sums them. agc_uncounted_passes checks it: two counted 64-sample draws around one uncounted draw give 128. Without the pause, it reads 192.
  • agc_driver_sample_multisample_target also checks that:
    • a read after the target is drawn again in another color returns the new sample 0 (if the copy is made only once, that read returns the old color);
    • with a BGRA8 and an RGBA16F 4x target live at one address, the RGBA16F read takes the matching target (if the lookup stops at the first mismatch, it throws);
    • the image_sample_l at LOD 1 uses an S# that allows it (MAX_LOD 15.99, point mip filter); the copy has a single level.
  • From the pre-merge review: FirstSampleCopy::Record takes the source view's layout instead of assuming GENERAL; the UINT and SINT passes are tested and the reads are compared bit for bit; 8- and 16-bit texels are measured and pinned in agc_shader_memory; both debt entries state the gap first and stay under 1000 characters.
  • Still not covered: the copy is redone on every binding even when the target did not change; the gate reuses cubeFaceCompatible, which #6799 extended to mip-less stores (the gate still takes sampled reads only); and the GPU test reads through compute dispatches only, without bilinear filtering.

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: PPSA18216 #5268
  • GPUs tested: AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002 and 32.0.21045.16010, Windows 11 26200
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4917877049 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7803). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-19T08:10:52Z. --- ### What METAL GEAR SOLID: Peace Walker (PPSA18216) stops at the opening movie's last copy (#5268). A pixel shader reads its 4-sample 1440x816 RGBA8 target through a plain DIM 2D `image_sample`, and the recompiler refuses the T#: ``` image descriptor is incompatible with the static runtime image interface: descriptor format 56 decodes to {class 1, dim 6, ...}; ... T# 02754d00 c3800000 00cbc167 e1b20fac 00000000 00700020 00000000 00000000 ``` What RDNA returns for a DIM 2D read of a 2D MSAA T# was the open question (@mrfelek, @SandstromPL). On an RX 6700 XT (gfx1031), through HIP, it is **sample 0** ([measurement on #5268](https://github.com/boykopovar/AnyPS5/discussions/5268#discussioncomment-19024106)): - `image_sample` (implicit LOD), `image_sample_lz` and `image_load` without a mip, through a T# built like the title's (format 22), return sample 0 in 1024 of 1024 lanes on a 256x256 surface spanning 16 64 KiB blocks, where a TYPE 9 (2D) T# over the same memory matched sample 0 in only 60. - `image_sample_l` at LOD 0 to 3, through an S# with MAX_LOD 15.99 and each mip filter, returns sample 0 in 256 of 256 lanes of a 16x16 surface through a T# built the same way. With a point mip filter, the same S# at LOD 1 and 2 reads another level of a 3-level TYPE 9 T# over the same memory, so the LOD takes effect. - A bilinear sample blends the neighbouring pixels' sample 0 (240 of 240), never the 4-sample average. - `image_load_mip` DIM 2D with mip N returns sample N. - A wider run ([data](https://gist.github.com/thuanquang/abbc8827bc7cce65586eceb4570a7c31)) gives the same for `image_sample`, `image_sample_lz` and `image_load` at 2, 4 and 8 samples, for formats 22, 29, 56, 60, 64, 71 and 77 in SW_64KB_R_X and the 32-bit formats in SW_64KB_Z_X. Its `image_sample_l` rows used an all-zero S#, which clamps the LOD to 0 ([correction](https://gist.github.com/thuanquang/abbc8827bc7cce65586eceb4570a7c31#file-correction-md)). - An 8- and 16-bit run ([data](https://gist.github.com/thuanquang/ab39395ccf82336d69cbf944a323df62)) gives the same at 2, 4 and 8 samples in SW_64KB_R_X and SW_64KB_Z_X for 8_UNORM, 8_UINT, 16_UNORM, 16_UINT, 16_FLOAT, 8_8_UNORM, 8_8_UINT and 5_6_5_UNORM (8_SINT and 16_SINT at 4 samples in SW_64KB_R_X). It also measures `image_sample_l` at LOD 1, 2 and 3 through an S# with MAX_LOD 15.99, with a control showing that S# reads mip 1 of a TYPE 9 T#, for those texels and for 32_FLOAT and 8_8_8_8_UNORM (the title's format) in SW_64KB_R_X. - Measured at LOD 0 only: `image_sample_l` for formats 29, 60, 64, 71 and 77 and for the 32-bit formats in SW_64KB_Z_X, and implicit-LOD `image_sample` everywhere. 64- and 128-bit texels in SW_64KB_Z_X, and SW_64KB_S_X and SW_64KB_D_X, do not address samples on this GPU (every sample index reads the same texel), so they are not covered. This change reads it that way: - **Recompiler** (`ResourceMaterializer.cpp`): a 2D MSAA T# decodes as Dim2D when the access is a direct sampled image read only through `image_load` without a mip and `image_sample`, `_lz` or `_l` (the reads `cubeFaceCompatible` tracks, taken for sampled images only), without a depth compare, R128, FMASK or depth-bits format. The shader then uses the existing 2D runtime mode, so sampling, filtering and LOD stay native. Storage, atomics, image tables, depth compares, gathers, bias, gradients, offsets and `image_load_mip` keep the existing refusal. The gate has no element-size check: the 8- and 16-bit run covers the narrower texels. - **Driver**: an Image2D binding over a 2D MSAA resource gets a one-sample copy of sample 0 (`MultisampleTargetFirstSample`). After the usual `Sampled()` checks (CMASK/HTILE, fast clears, pending storage writes, barrier), a fragment pass (`FirstSampleCopy`, `texelFetch` of sample 0 into a one-sample attachment of the target's format) refreshes the copy before each such binding. The pass reads the target's sampled view in the layout that view reports (`Texture::Layout()`), and creates its shader modules through `CreateShaderModule`, the path #6436 made for every module the driver creates. Float, UNORM, SNORM and sRGB formats go through a float pass; UINT and SINT formats go through `usampler2DMS` and `isampler2DMS` passes, which copy the bits. It works for a live target, a red/blue-swapped one, and a texture no draw rendered to (`createFilled`). A Vulkan resolve would not do: it averages float and UNORM samples. A multisampled depth surface read this way throws. The debt entries state the gaps first. The reads are measured on gfx1031, not the console's gfx1013. Implicit LOD above 0, explicit LOD above 0 for texels over 16 bits other than formats 22 and 56 in SW_64KB_R_X, and other formats and swizzle modes are not measured. 64- and 128-bit SW_64KB_Z_X texels are not covered. Float, UNORM, SNORM and sRGB values pass through a shader and a color attachment, which Vulkan does not require to keep exact. ### Tested Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002 and 32.0.21045.16010, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, `ANYPS5_REQUIRE_VULKAN=1`. Rebased onto `main` `9d6adeb550`: this head (`0a3ea213e1`) is one commit on it; the one conflict was in `tests/ShaderMemory.cpp`, where `main` added a `verifyArrayVolumeStoreMode()` call in `main()` on the line where this change adds `verifyMultisamplePlaneReadMode()`; both calls are kept, and the rest of the patch is unchanged. On this head, with AMD driver 32.0.21045.16010, the six focused tests below pass 3 of 3, and a validation layer run of the six (same environment as the validation layer run below) passes with no `VUID-` error and no `was not found but was requested` line. The full AGC suite on this head (`ctest -R ^agc_ -j 1`): 902 of 905 pass; the three failures, `agc_driver_sample_order`, `agc_driver_sample_order_grid_reference` and `agc_driver_sample_order_recipe_depth_locations`, fail on `main` on this machine as well (seen on `main` `d6eafa54d`). The rebase before it, onto `001d132f47` (head `e0f6ea8ed6`), had one conflict in `MultisampleTarget.cpp`, where #8847 (sRGB twin formats) added `View(VkFormat)` and `Serves()`, made `ResolvePass()` per format and destroys the twin view in `release()`, next to this change's `FirstSample()` and its two `release()` lines; both are kept, and with AMD driver 32.0.21045.16010 the six focused tests below passed 3 of 3 on it. The rebase before that, onto `8b3a6ba88d` (head `0ad8aa3278`), had one conflict: `main` added `imageCoordinates()` in `ResourceMaterializer.cpp` where this change adds `multisamplePlaneRead()`, and both are kept. `main`'s new GCN-only address-count check runs before this change's sample-0 rule, so GCN shaders behave as on `main`. On that head, with AMD driver 32.0.21045.16010, the six focused tests below passed 3 of 3; with `main`'s `ResourceMaterializer.cpp` on it, `agc_shader_memory` failed with `descriptor format 56 decodes to {class 1, dim 6, ...}` as below. Before that, the rebase onto `2f161d4f33` (head `9ac1a20ce4`) had one conflict: `main` added its SampleOrder shader block in `core/libs/prx/libSceAgcDriver/CMakeLists.txt` where this change adds the FirstSample block, and both are kept. On that head the six focused tests below passed 3 of 3, and the validation layer run (A: `main` `2f161d4f33` with #9115's libSceNpTrophy2-only commit, which none of these tests load; B: `9ac1a20ce4`) has no `VUID-` line and no `was not found but was requested` on either side; A has five of the six, since `agc_uncounted_passes` comes with this change. Before that, the rebase onto `7ab4b2e56` had one conflict too: #7966 added a `depth1D` check on the lines where this change adds `firstSample`, and both checks are kept. - `agc_shader_memory`, new `verifyMultisamplePlaneReadMode`: a sampled Dim2D access to the title's T# selects the float 2D runtime mode, and 2D MSAA T#s with 8- and 16-bit texels select the 2D mode of their numeric class (4x 8_UNORM and 4x 16_SINT in SW_64KB_R_X, 2x 8_UINT and 8x 16_FLOAT in SW_64KB_Z_X). A 4x 16_UINT SW_64KB_Z_X T#, which is read as depth bits, an access outside the measured set (`cubeFaceCompatible` false), a depth compare and a storage access are refused. - `agc_driver_sample_multisample_target`, new `CheckFirstSampleReads`: DIM 2D `image_load`, `image_sample_lz` and `image_sample_l` at LOD 1 through the 4x target's TYPE 14 T# return each pixel's sample 0, bit for bit, as the target's DIM 2D_MSAA `image_load` reads it. It checks every pixel of: - the drawn RGBA16F target, where some pixels' sample 0 differs from another of its samples, so a resolve would fail the check; - a BGRA8 target read through an RGBA8 T# (the red/blue swap); - zeroed memory no draw rendered to; - a drawn 4x 8_8_8_8_UINT target and 8_8_8_8_SINT color memory no draw rendered to, with negative channels, through the UINT and SINT passes. These two cases run only where `sampledImageIntegerSampleCounts` includes 4 samples (Vulkan requires only 1); elsewhere the test prints `DIM 2D reads of 4x 8_8_8_8_UINT and 8_8_8_8_SINT targets not tested: sampledImageIntegerSampleCounts lacks VK_SAMPLE_COUNT_4_BIT` and goes on. The RX 6700 XT runs them. - Red on `main` `7f596df48` with only this PR's tests: `agc_shader_memory` fails with `descriptor format 56 decodes to {class 1, dim 6, ...}`, the title's refusal, and `agc_driver_sample_multisample_target` with the same refusal for its RGBA16F target (format 71). - With only the recompiler half: `agc_shader_memory` passes, and the GPU test fails one step later, at the driver: `guest texture dimension disagrees with the shader's declared image shape (shape 1, dimension 6)`. - Green: both pass 3 of 3 on `7f596df48`, and after rebasing onto `main` `fb0dc118f`. - Head `5b7894778` (on `main` `7ab4b2e56`): `agc_shader_memory`, `agc_driver_sample_multisample_target`, `agc_driver_native_msaa_vertex_input`, `agc_driver_graphics`, `agc_uncounted_passes` and `agc_sample_dumps` pass 3 of 3. - Head `aae3228a5` (on `main` `b85d972f4`): `agc_shader_memory`, `agc_driver_sample_multisample_target`, `agc_driver_native_msaa_vertex_input`, `agc_driver_graphics`, `agc_uncounted_passes` and `agc_sample_dumps` pass 3 of 3, and once more after the controls below were restored and rebuilt. - Controls on `aae3228a5`, each built and run on its own, then restored: - the UINT pass reading sample 1: `agc_driver_sample_multisample_target` fails with `a DIM 2D image_load of pixel (9, 11) read 00000000 00000000 00000000 00000000, sample 0 is 00000012 000000be 00000042 00000081 from a drawn 4x 8_8_8_8_UINT target`; - the SINT pass writing its channels in reverse order: it fails with `a DIM 2D image_load of pixel (0, 0) read ffffff81 ffffffbe ffffffff 00000012, sample 0 is 00000012 ffffffff ffffffbe ffffff81 from 8_8_8_8_SINT color memory no draw rendered to`; - RGBA8 UINT and SINT taken through the float pass: the test passes on this driver, which copies those bits through the float pass. Only the validation layer catches it: `VUID-vkCmdDraw-format-07753` (the view's numeric type must match the shader's sampled type), reported 10 times, the layer's default limit for one message, and 2 `Undefined-Value-ShaderFragmentOutputMismatch` warnings; - an element-size check in the gate (`GetFormatInfo(format).byteSize >= 4u`): `agc_shader_memory` fails at the 8_UNORM row with `descriptor format 1 decodes to {class 1, dim 6, ...}`; - the gate without its depth-bits check: `agc_shader_memory` fails with `a 2D read of a 16_UINT SW_64KB_Z_X 2D MSAA T#, read as depth bits, was accepted`; - the integer cases' device check forced to report no 4-sample integer sampling: the test prints the line above, skips only those two cases, runs the rest and passes. - On an earlier head (`e7ab9e7c1` on `main` `fb0dc118f`), the full `ctest --parallel 4 --timeout 120`: 1605 tests, 9 fail, none of which reads a multisampled texture: - the three AMD failures `main` has here (`agc_driver_lds_mixed_width_atomics` #6976, `agc_driver_lds_lock_budget` #7344, `agc_driver_layered_volume_vertex_no_gpl` #4768); - `agc_trimmed_import`, the new test from #6499, which fails the same way on `main` on this machine; - `agc_driver_draw_cache_reuse_off` and `agc_driver_stencil_replay_no_gpl`, which lose the device under their usual names and pass from renamed copies (AMD's per-executable pipeline cache, as in #4768); - `guest_nanosleep_timer_self_test`, a timing test, which timed out while other builds were running; - `log_macros` and `log_macros_timestamps`, which fail only in this local build because ccache's base directory turns `__FILE__` into a relative path with backslashes. - Khronos validation layer (vulkan-sdk-1.4.363.0), `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`, same RX 6700 XT, on `main` `7ab4b2e56` and on `5b7894778`, this change rebased onto it. `agc_shader_memory`, `agc_driver_sample_multisample_target`, `agc_driver_native_msaa_vertex_input`, `agc_driver_graphics` and `agc_sample_dumps` pass on both, and the new `agc_uncounted_passes` passes on `5b7894778` (6 of 6). Neither log has a `was not found but was requested` line or a `VUID-` error. The same environment reports the float-pass control above, so the layer was loaded. - `python tools/check_conventions.py --base origin/main` with this title and body passes. - In the title ([@mrfelek](https://github.com/boykopovar/AnyPS5/pull/7803#issuecomment-6266226115), Linux, RTX 3080 Ti, `main` + #6842 + this PR at `b216fe3a3`): Peace Walker gets past the read `main` refuses, starts `mgspw` and reaches the title screen, with no `image descriptor is incompatible` in the log and no abort in 9 minutes on the title screen and its attract movies. Whether the picture at the copy matches a resolve was not compared. - With #8871 ([@mrfelek](https://github.com/boykopovar/AnyPS5/pull/8871#issuecomment-6321558359), Linux, RTX 3080 Ti, `main` `cecb540a6` + this PR `9ac1a20ce` + #8871 `593f4ab86`, without local changes): Peace Walker plays through New Game into the beach tutorial at about 60 FPS, with no driver error in the log. - Apple M2 Max on MoltenVK ([@jotitadev](https://github.com/boykopovar/AnyPS5/pull/7803#pullrequestreview-5569595319), head `b216fe3a3` with the storage-multisampling gate moved below the sample-0 checks locally): the sample-0 and BGRA8 checks pass, and fail with the recompiler change reverted. MoltenVK has no `shaderStorageImageMultisample`. The gate has sat there since `09c3d719f`, so devices without storage multisampling run those checks and skip only the fill, store and swizzle cases. The UINT and SINT cases are newer than that run. - Linux, RX 9070 XT on RADV ([@blawesom](https://github.com/boykopovar/AnyPS5/pull/7803#issuecomment-6263998528), their rebase `7ecc1293f` of head `b216fe3a3`): the full suite has no failures from this PR. - Linux, NVIDIA RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), head `9ac1a20ce` on `main` `a6dcea927` ([@jotitadev](https://github.com/boykopovar/AnyPS5/pull/7803#pullrequestreview-5608236487)): `agc_driver_sample_multisample_target` fails on both with `ShaderResources.cpp` and `ResourceMaterializer.cpp` reverted (`image descriptor is incompatible with the static runtime image interface`, the DIM 6 T#) and passes with this PR; lavapipe runs the multisampled storage-image path that MoltenVK skips. `agc_uncounted_passes` passes on both, and the rest of the `^agc` suite matches `main` (NVIDIA 859/862, lavapipe 861/862, only failures `main` already has there). - Not tested: the console (gfx1013). From the reviews of this change: - The copy pass is recorded through a new `Recorder::RecordUncounted`. When the recorder counts occlusion over a whole batch (the fallback without segment queries), it ends that query around the copy and starts a new one, and the batch's sample count sums them. `agc_uncounted_passes` checks it: two counted 64-sample draws around one uncounted draw give 128. Without the pause, it reads 192. - `agc_driver_sample_multisample_target` also checks that: - a read after the target is drawn again in another color returns the new sample 0 (if the copy is made only once, that read returns the old color); - with a BGRA8 and an RGBA16F 4x target live at one address, the RGBA16F read takes the matching target (if the lookup stops at the first mismatch, it throws); - the `image_sample_l` at LOD 1 uses an S# that allows it (MAX_LOD 15.99, point mip filter); the copy has a single level. - From the pre-merge review: `FirstSampleCopy::Record` takes the source view's layout instead of assuming GENERAL; the UINT and SINT passes are tested and the reads are compared bit for bit; 8- and 16-bit texels are measured and pinned in `agc_shader_memory`; both debt entries state the gap first and stay under 1000 characters. - Still not covered: the copy is redone on every binding even when the target did not change; the gate reuses `cubeFaceCompatible`, which #6799 extended to mip-less stores (the gate still takes sampled reads only); and the GPU test reads through compute dispatches only, without bilinear filtering. ### 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: PPSA18216 #5268 - [x] GPUs tested: AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002 and 32.0.21045.16010, Windows 11 26200 - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
blawesom commented 2026-10-19 09:25:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T09:25:35Z.


Rebase handoff — rebased onto current main cleanly (authorship unchanged).

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the four known main regressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7803
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 7ecc1293f.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6263998528 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7803#issuecomment-6263998528). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-19T09:25:35Z. --- **Rebase handoff** — rebased onto current `main` cleanly (authorship unchanged). Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): builds; conventions pass; **full suite green apart from the four known `main` regressions** (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR. **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/7803 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `7ecc1293f`.
jotitadev commented 2026-10-19 09:39:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T09:39:35Z.

Review: COMMENTED


Apple GPU / MoltenVK run. On Apple, agc_driver_sample_multisample_target is skipped as a whole, so the new sample-0 cases never run: MoltenVK doesn't expose shaderStorageImageMultisample, and the existing gate in main() returns before the first draw. The new cases don't seem to need storage multisampling. With the gate moved after them (local, test-only), they pass on both drivers, and they fail with the PR's driver and recompiler changes reverted.

Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK main + SPIRV-Cross #2704. Head b216fe3a3, PR diff applied cleanly.

Tested: the tree is main a373e85e5 + mugurc's macOS series (ci/macos-series-2) + the PRs needed to build on macOS (#6667, #6668, #7524, #6969, and two files of #7332), not plain main (it doesn't build on macOS yet). Applied together in the same build: #7666, #7811, #7799 and #7803, plus a test-only patch that lets nine AGC fixtures load the Vulkan loader on macOS (branch jotitadev:fix/agc-tests-vulkan-loader-macos). Base on that tree: 40 ^agc failures with MoltenVK 1.4.2 and 26 with MoltenVK main + #2704, plus agc_driver_pooled_buffer_range and agc_performance_overlay, which only run because of the loader patch.

  • With the PR, unchanged: agc_driver_sample_multisample_target reports multisampled target sampling not tested: storage image multisampling unavailable (skip). agc_shader_memory passes 3 of 3.
  • With the storageImageMultisample check moved below the std::puts("DIM 2D image_load, image_sample_lz and image_sample_l reads ...") line, the draw, LoadSamples and the first two CheckFirstSampleReads calls (the drawn 4x target, and zeroed memory no draw rendered to) run and pass on both drivers. Then the test skips at the moved gate. I also copied the BGRA8 block (DecodeSwappedTarget, CheckSwappedSamples and its CheckFirstSampleReads through an RGBA8 descriptor, format 56 as in the title) above the gate. All three first-sample checks pass, 3 runs of 3 on each driver. So the FirstSampleCopy pass works on Metal, including the check that sample 0 differs from the average.
  • With ResourceMaterializer.cpp reverted (test kept, gate moved), the test fails on both drivers with the refusal from the description, here for the test's format-71 target: image descriptor is incompatible with the static runtime image interface: descriptor format 71 decodes to {class 1, dim 6, ...}. agc_shader_memory fails the same way for format 56.
  • Full ^agc suite with the stack (gate moved): the base failures on each driver, nothing new and nothing gone.

Moving the gate below the first-sample checks (and the BGRA8 block with them) would let devices without storage multisampling, such as MoltenVK, cover this path. The store cases further down still need the gate.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704)

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5569595319 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7803#pullrequestreview-5569595319). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-19T09:39:35Z. **Review:** COMMENTED --- <!-- head: b216fe3a3 --> Apple GPU / MoltenVK run. On Apple, `agc_driver_sample_multisample_target` is skipped as a whole, so the new sample-0 cases never run: MoltenVK doesn't expose `shaderStorageImageMultisample`, and the existing gate in `main()` returns before the first draw. The new cases don't seem to need storage multisampling. With the gate moved after them (local, test-only), they pass on both drivers, and they fail with the PR's driver and recompiler changes reverted. Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK main + SPIRV-Cross #2704. Head b216fe3a3, PR diff applied cleanly. **Tested:** the tree is `main` a373e85e5 + mugurc's macOS series (`ci/macos-series-2`) + the PRs needed to build on macOS (#6667, #6668, #7524, #6969, and two files of #7332), not plain `main` (it doesn't build on macOS yet). Applied together in the same build: #7666, #7811, #7799 and #7803, plus a test-only patch that lets nine AGC fixtures load the Vulkan loader on macOS (branch `jotitadev:fix/agc-tests-vulkan-loader-macos`). Base on that tree: 40 `^agc` failures with MoltenVK 1.4.2 and 26 with MoltenVK main + #2704, plus `agc_driver_pooled_buffer_range` and `agc_performance_overlay`, which only run because of the loader patch. - With the PR, unchanged: `agc_driver_sample_multisample_target` reports `multisampled target sampling not tested: storage image multisampling unavailable` (skip). `agc_shader_memory` passes 3 of 3. - With the `storageImageMultisample` check moved below the `std::puts("DIM 2D image_load, image_sample_lz and image_sample_l reads ...")` line, the draw, `LoadSamples` and the first two `CheckFirstSampleReads` calls (the drawn 4x target, and zeroed memory no draw rendered to) run and pass on both drivers. Then the test skips at the moved gate. I also copied the BGRA8 block (`DecodeSwappedTarget`, `CheckSwappedSamples` and its `CheckFirstSampleReads` through an RGBA8 descriptor, format 56 as in the title) above the gate. All three first-sample checks pass, 3 runs of 3 on each driver. So the `FirstSampleCopy` pass works on Metal, including the check that sample 0 differs from the average. - With `ResourceMaterializer.cpp` reverted (test kept, gate moved), the test fails on both drivers with the refusal from the description, here for the test's format-71 target: `image descriptor is incompatible with the static runtime image interface: descriptor format 71 decodes to {class 1, dim 6, ...}`. `agc_shader_memory` fails the same way for format 56. - Full `^agc` suite with the stack (gate moved): the base failures on each driver, nothing new and nothing gone. Moving the gate below the first-sample checks (and the BGRA8 block with them) would let devices without storage multisampling, such as MoltenVK, cover this path. The store cases further down still need the gate. GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704) Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
mrfelek commented 2026-10-19 11:33:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-19T11:33:17Z.


@thuanquang ran it in the title on Linux / NVIDIA.

Setup:

  • Host: Ubuntu 26.10 (kernel 7.3), Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09 open), GCC 15.3.0, Release.
  • Build: main f71a31193 + #6842 (Peace Walker still needs it) + this PR at b216fe3a3, both merged cleanly. No local changes, no APS5_PROBE_* switch, so none of my resolve code.

Result: the game gets past the read that main refuses.

  • In my earlier resolve runs, that read comes about 15–20 s after a cold start, when the game opens stagedat.pdt and samples the 1440x816 4-sample targets at 0x2754d0000 (your T#) and 0x277fc0000.
  • With this PR the game passes that point, starts mgspw and reaches the title screen.
  • image descriptor is incompatible doesn't appear anywhere in the log, and nothing aborted in 9 minutes on the title screen and its attract movies.

What I haven't checked: whether the picture at that moment matches my resolve's. My frame dumps from both processes went to the same file names, so the frames around the read were overwritten. If you need that comparison, I can rerun with frames saved around the read in both builds.

AI-assisted; the runs are from my machine(s).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6266226115 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7803#issuecomment-6266226115). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-19T11:33:17Z. --- @thuanquang ran it in the title on Linux / NVIDIA. **Setup:** - **Host:** Ubuntu 26.10 (kernel 7.3), Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09 open), GCC 15.3.0, Release. - **Build:** `main` f71a31193 + #6842 (Peace Walker still needs it) + this PR at b216fe3a3, both merged cleanly. No local changes, no `APS5_PROBE_*` switch, so none of my resolve code. **Result:** the game gets past the read that `main` refuses. - In my earlier resolve runs, that read comes about 15–20 s after a cold start, when the game opens `stagedat.pdt` and samples the 1440x816 4-sample targets at `0x2754d0000` (your T#) and `0x277fc0000`. - With this PR the game passes that point, starts `mgspw` and reaches the title screen. - `image descriptor is incompatible` doesn't appear anywhere in the log, and nothing aborted in 9 minutes on the title screen and its attract movies. What I haven't checked: whether the picture at that moment matches my resolve's. My frame dumps from both processes went to the same file names, so the frames around the read were overwritten. If you need that comparison, I can rerun with frames saved around the read in both builds. AI-assisted; the runs are from my machine(s).
thuanquang commented 2026-10-19 19:23:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-19T19:23:02Z.


@jotitadev thanks for the MoltenVK runs. The gate now sits below the sample-0 and BGRA8 checks (09c3d719f), so devices without shaderStorageImageMultisample run them and skip only the fill, store and swizzle cases. On the RX 6700 XT the test passes, and with the gate forced on, the sample-0 and BGRA8 checks run and pass before the skip.

@mrfelek thanks for running it in the title. I've added your result to the description.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6275380959 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7803#issuecomment-6275380959). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-19T19:23:02Z. --- @jotitadev thanks for the MoltenVK runs. The gate now sits below the sample-0 and BGRA8 checks (`09c3d719f`), so devices without `shaderStorageImageMultisample` run them and skip only the fill, store and swizzle cases. On the RX 6700 XT the test passes, and with the gate forced on, the sample-0 and BGRA8 checks run and pass before the skip. @mrfelek thanks for running it in the title. I've added your result to the description.
jotitadev commented 2026-10-22 01:30:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T01:30:46Z.

Review: COMMENTED


Adds NVIDIA and lavapipe (native Linux). Worth noting lavapipe runs agc_driver_sample_multisample_target in full here, where on Apple through MoltenVK the whole test skips (no shaderStorageImageMultisample), so this is a red→green on a device that actually executes the multisampled storage-image path.

Tested

Ubuntu 26.04, GCC 15.2.0, Release, BUILD_TESTING=ON, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1, device selected with VK_ICD_FILENAMES, serial CTest, on main a6dcea927 (this PR applies cleanly on it; head 9ac1a20ce).

agc_driver_sample_multisample_target NVIDIA RTX 3070 (595.99.02) lavapipe (Mesa 26.0.3, LLVM 21.1.8)
main a6dcea927 + the PR's test only (ShaderResources.cpp and ResourceMaterializer.cpp reverted) fail fail
this PR pass pass

With the two production files reverted and the test kept, both devices exit non-zero in ShaderRecompiler::Recompile with:

image descriptor is incompatible with the static runtime image interface: descriptor format 71 decodes to {class 1, dim 6, ...}; modes: {class 1, dim 3, ...} ...

That is the DIM 6 (2D MSAA) T# that main cannot match to any of the DIM 3 (2D) runtime modes; with the full PR the recompiler reads it through DIM 2D as sample 0 and both devices pass. agc_uncounted_passes, the test this PR adds, also passes on both.

The rest of the guarded ^agc suite is unchanged from main on both devices: NVIDIA 859/862, lavapipe 861/862, i.e. main + the one agc_uncounted_passes this PR adds. The only remaining failures are the pre-existing ones main already has here (sample_order family on NVIDIA, multisample_retirement on lavapipe).

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5608236487 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7803#pullrequestreview-5608236487). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-22T01:30:46Z. **Review:** COMMENTED --- Adds NVIDIA and lavapipe (native Linux). Worth noting lavapipe runs `agc_driver_sample_multisample_target` in full here, where on Apple through MoltenVK the whole test skips (no `shaderStorageImageMultisample`), so this is a `red→green` on a device that actually executes the multisampled storage-image path. ### Tested Ubuntu 26.04, GCC 15.2.0, Release, `BUILD_TESTING=ON`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`, device selected with `VK_ICD_FILENAMES`, serial CTest, on `main` `a6dcea927` (this PR applies cleanly on it; head `9ac1a20ce`). | `agc_driver_sample_multisample_target` | NVIDIA RTX 3070 (595.99.02) | lavapipe (Mesa 26.0.3, LLVM 21.1.8) | |---|---|---| | `main` `a6dcea927` + the PR's test only (`ShaderResources.cpp` and `ResourceMaterializer.cpp` reverted) | **fail** | **fail** | | this PR | pass | pass | With the two production files reverted and the test kept, both devices exit non-zero in `ShaderRecompiler::Recompile` with: ``` image descriptor is incompatible with the static runtime image interface: descriptor format 71 decodes to {class 1, dim 6, ...}; modes: {class 1, dim 3, ...} ... ``` That is the DIM 6 (2D MSAA) T# that `main` cannot match to any of the DIM 3 (2D) runtime modes; with the full PR the recompiler reads it through DIM 2D as sample 0 and both devices pass. `agc_uncounted_passes`, the test this PR adds, also passes on both. The rest of the guarded `^agc` suite is unchanged from `main` on both devices: NVIDIA 859/862, lavapipe 861/862, i.e. `main` + the one `agc_uncounted_passes` this PR adds. The only remaining failures are the pre-existing ones `main` already has here (`sample_order` family on NVIDIA, `multisample_retirement` on lavapipe). GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
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!7803
No description provided.