Skip to content

fix(shader,agc): support multisampled 2D array descriptor image shape and runtime views - #6635

Merged
oneandonlydean merged 9 commits into
boykopovar:mainfrom
hamb3r:fix/shader-msaa-array-descriptor-shape
Oct 18, 2026
Merged

oneandonlydean merged 9 commits into
boykopovar:mainfrom
hamb3r:fix/shader-msaa-array-descriptor-shape

Conversation

@hamb3r

@hamb3r hamb3r commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Add DescriptorImageShape::Image2DMultisampleArray in Recompiler.hpp.
  • Map ImageDimension::Dim2DMsaaArray (isArray && isMsaa) to DescriptorImageShape::Image2DMultisampleArray in DescriptorBindingBuilder::Populate instead of throwing multisampled array image resources have no descriptor image shape.
  • Match DescriptorImageShape::Image2DMultisampleArray against TextureDimension::k2DMsaa in GuestTextureResource::MatchesGuestDimension.
  • Thread VkImageViewType (VK_IMAGE_VIEW_TYPE_2D_ARRAY for DescriptorImageShape::Image2DMultisampleArray, VK_IMAGE_VIEW_TYPE_2D for DescriptorImageShape::Image2DMultisample) through ShaderResources, MultisampleTarget::Sampled, and DepthSurface::Sampled, including the view type in the sampled texture cache keys.
  • Add unit and GPU execution tests in agc_shader_memory, agc_driver_graphics (Recorder.cpp), agc_driver_sample_multisample_target, and agc_driver_native_multisample_depth covering Dim2DMsaaArray descriptor binding generation, guest texture dimension matching, VK_IMAGE_VIEW_TYPE_2D_ARRAY runtime view binding/caching, and ImageMSArray OpImageFetch execution on MSAA color and depth targets.

Tested

  • Windows 10, ctest --test-dir build-portable -R "^(agc_driver_graphics|agc_shader_memory|agc_multisample_guest_access|agc_driver_sample_multisample_target|agc_driver_native_multisample_depth)$" --output-on-failure (all passed).
  • Windows 10, PPSA28997 (God of War: Sons of Sparta): verified that the two shader library prebuild skipped: DescriptorBindingBuilder::Populate multisampled array image resources have no descriptor image shape errors during unity default resources shader registration are resolved.

Before (main):

[+1.410582 s] [src/Open.cpp:215 sceKernelOpen] path=/app0/Media/Resources/unity default resources flags=0x0 nativeFlags=0x8000 mode=00
[+0.754503 s] [Shaders/ShaderRegistry.cpp:904 PrepareRegistered] shader library prebuild skipped: DescriptorBindingBuilder::Populate multisampled array image resources have no descriptor image shape
[+0.755115 s] [Shaders/ShaderRegistry.cpp:904 PrepareRegistered] shader library prebuild skipped: DescriptorBindingBuilder::Populate multisampled array image resources have no descriptor image shape
[capture] 1 captures: 0 word reads, 0 pages fetched (0 read word by word over pending GPU writes: 0 words waited 0.00 s, 0 read raw on evidence, 0 verified with 0 mismatches, 0 served from known values, 0 hook reads not observed: no GPU wait), capture (plan lookup + materialize) 0.0 s, 1 KiB registered code this capture; sub-phases (s, us per capture): source resolve 0.00/0.0, walk 0.00/31.6, specialization (every materialize) 0.00/0.1, page reads 0.00/0.0, word reads 0.00/0.0, hook GPU waits inside 0.00/0.0, materialize 0.00/30.1 (SRT evaluate 0.00/22.0); source handle memo 0 hits, 0 resolves
[+0.780049 s] [src/Texture.cpp:1090 StorageTexture] StorageTexture address=0x217670000 1920x1080 mips=1 mip=0 layers=0 base=0 dim=1 tile=7 format=56 vk=37
[+1.499849 s] [src/Open.cpp:215 sceKernelOpen] path=/app0/Media/globalgamemanagers.assets flags=0x0 nativeFlags=0x8000 mode=00

After (this PR):

[+0.640242 s] [src/Open.cpp:215 sceKernelOpen] path=/app0/Media/Resources/unity default resources flags=0x0 nativeFlags=0x8000 mode=00
[capture] 1 captures: 0 word reads, 0 pages fetched (0 read word by word over pending GPU writes: 0 words waited 0.00 s, 0 read raw on evidence, 0 verified with 0 mismatches, 0 served from known values, 0 hook reads not observed: no GPU wait), capture (plan lookup + materialize) 0.0 s, 1 KiB registered code this capture; sub-phases (s, us per capture): source resolve 0.00/0.0, walk 0.00/18.5, specialization (every materialize) 0.00/0.2, page reads 0.00/0.0, word reads 0.00/0.0, hook GPU waits inside 0.00/0.0, materialize 0.00/30.1 (SRT evaluate 0.00/12.2); source handle memo 0 hits, 0 resolves
[+0.435864 s] [src/Texture.cpp:1090 StorageTexture] StorageTexture address=0x217670000 1920x1080 mips=1 mip=0 layers=0 base=0 dim=1 tile=7 format=56 vk=37
[buffers] descriptor elements bound: 1 total, 0 written, 1 read-only; 1 pending-write notes skipped
[+0.721886 s] [src/Open.cpp:215 sceKernelOpen] path=/app0/Media/globalgamemanagers.assets flags=0x0 nativeFlags=0x8000 mode=00

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
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3080, driver 591.74, Windows 10
  • AI-assisted: yes

Comment thread core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
@hamb3r

hamb3r commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

cc @adriadam10 @oneandonlydean

@MarcZX10

Copy link
Copy Markdown
Contributor

I traced this into MultisampleTarget::Sampled: it creates Texture(context, image, ...) with the default VK_IMAGE_VIEW_TYPE_2D, while the new descriptor shape emits an arrayed multisample image type. Unless this path is intentionally using a non-array view for k2dArrayMsaa, the descriptor and view dimensionality appear inconsistent. Could the runtime sampled view be made array-shaped and covered by a test, or could this PR reject the unsupported runtime path explicitly?

@hamb3r hamb3r changed the title fix(shader,agc): support multisampled 2D array descriptor image shape fix(shader,agc): support multisampled 2D array descriptor image shape and runtime views Oct 16, 2026
@hamb3r

hamb3r commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

@MarcZX100 Good catch — addressed in 729558c and 026e69f:

  • Threaded VkImageViewType (VK_IMAGE_VIEW_TYPE_2D_ARRAY for DescriptorImageShape::Image2DMultisampleArray, VK_IMAGE_VIEW_TYPE_2D for DescriptorImageShape::Image2DMultisample) through ShaderResources (both GuestImages and ImageTable paths, plus PreviousSampled), MultisampleTarget::Sampled, and DepthSurface::Sampled, and included the view type in the sampled texture cache keys.
  • Added unit and GPU execution coverage in tests/Recorder.cpp (verifying SampledViewRange(false).type == VK_IMAGE_VIEW_TYPE_2D_ARRAY and separate caching of 2D vs. 2D-array views), tests/execution/SampleMultisampleTarget.cpp (executing an RDNA Dim2DMsaaArray image_load shader on the 4x MSAA color target), and tests/execution/NativeMultisampleDepth.cpp (executing an arrayed ImageMSArray OpImageFetch shader on the 4x MSAA depth target).

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6175 core/libs/prx/libSceAgcDriver/Graphics/include/MultisampleTarget.hpp L57-58
PR 6215 core/libs/prx/libSceAgcDriver/Graphics/include/MultisampleTarget.hpp L57-58
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L242-246, L302, L699-700
PR 6557 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L814-815
PR 6683 core/libs/prx/libSceAgcDriver/Graphics/include/MultisampleTarget.hpp L57-58
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L230-231, L244
PR 6727 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L814-815
PR 6772 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L602
PR 7250 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L230-231, L302-303
PR 7258 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L4657
PR 7318 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L399-400, L422-424, L681-682, L1582
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L725-727

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 3247 core/shader/recompiler/Recompiler.hpp
PR 4650 core/shader/recompiler/Recompiler.hpp
PR 5021 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5371 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 5500 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.hpp
PR 5609 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/Recompiler.hpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/shader/recompiler/Recompiler.hpp
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.hpp
PR 6185 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/shader/recompiler/Recompiler.hpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.hpp
PR 6280 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6297 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 6300 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 6312 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/Recompiler.hpp
PR 6414 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6423 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6486 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/Recompiler.hpp
PR 6488 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6490 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6499 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6503 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.hpp
PR 6539 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/Recompiler.hpp
PR 6553 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6645 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6747 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6763 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 6868 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6879 core/shader/recompiler/Recompiler.hpp
PR 6905 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6937 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6941 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.hpp
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/shader/recompiler/Recompiler.hpp
PR 6972 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/shader/recompiler/Recompiler.hpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.hpp
PR 7381 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7388 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7390 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/shader/recompiler/Recompiler.hpp
PR 7426 core/shader/recompiler/Recompiler.hpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/Recompiler.hpp

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sampled-view shape concern from my earlier review is addressed on this head: the requested view type is threaded through the sampled color and depth paths, included in the texture cache keys, and covered by view-shape plus execution test cases. I found no remaining blocker in this change. The repository checks pass, while platform build/runtime jobs are skipped by path policy, so I am not claiming those new execution cases ran in CI.

@Amoenus Amoenus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent source review and cross-vendor validation of head 026e69fa6024858744eb1ae17995d9b84507356a on main 0615cd2b82926b2f4daf1d31ac9bc7354b6d0a17: no blocker found in the reviewed change.

Reproducible validation composition fd9f3d707: clean main + this PR, plus only #6225's fixture GPU selector and #6452's WinLibs test-alignment correction. These are test-infrastructure additions; this PR's production diff and new array assertions are unchanged.

  • Earlier main7dc composition 41a94acb2 passes the full Windows app/libraries and patched libs build, 27 Windows and 18 Linux runs. That full-build result stays at its original pin.
  • Latest tested fd9f3d707 includes main0615's dispatch/pipeline/journal and shader-cache changes. Affected Windows libraries/six targets and the same six Linux targets build; conventions and registration pass. Targeted revalidation passes 21 Windows runs and 12 Linux runs: three CPU groups once each (agc_shader_memory, agc_driver_graphics, agc_shader_disk_cache), and three GPU groups x3 per physical vendor/software device (agc_multisample_guest_access, agc_driver_sample_multisample_target, agc_driver_native_multisample_depth). GPU identity is verified in every GPU process; no whole-test skips/timeouts, maximum 7.140s.
  • Linux: Ubuntu24.04 / GCC13.3 / Mesa25.2.8 llvmpipe. Native-depth cases check D16/D32 at 4x (4 checked, 8 unavailable per process); both Windows GPUs check all 12 cases. CPU heap-mirror omissions are excluded from coverage. Dispatch uses the default mode; the optional APS5_PIPELINE_DISPATCH mode and journal replay are outside this matrix.
  • Color array loads agree with the checked non-array sample values; depth array fetches verify imported and rasterized values. The view tests check distinct 2D/2D-array cache entries and mixed consecutive bindings. Source inspection confirms the new enum is appended, preserving existing values.

GPUs tested: NVIDIA RTX5080 (10de:2c02), driver610.62/32.0.16.1062; AMD Radeon(TM) Graphics (1002:13c0), driver32.0.21036.18; Windows11 Enterprise26200 / WinLibs GCC15.2r7. Serial fresh processes, Vulkan required, project shader cache disabled; driver caches uncontrolled.

Coverage is array-shaped views of one-layer native targets, using layer zero. Source inspection confirms the decoder retains its nonzero MSAA depth/base-array refusal. Multiple resident layers, console equivalence and title startup remain untested here.

Main subsequently advanced to aff725bf6d8d61ed33e80507421fd131aeae1305 (#5884 mesh line-strip output and #5886 unnormalized-sampler base-level proof). I inspected the relevant hunks: the native view-type/cache plumbing and sampler-free array-load paths are unchanged, and the complete merge preview is clean. These later commits are outside the executed pins above; no unrelated matrix restart. AI-assisted: Codex; I ran these local builds/tests.

@hamb3r

hamb3r commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

cc @adriadam10 @oneandonlydean rebase

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 16, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 16, 2026
@hamb3r

hamb3r commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

cc @adriadam10 @oneandonlydean rebased again

@MarcZX10

Copy link
Copy Markdown
Contributor

I have a focused candidate for issue #6957: sample a multisampled target in SHADER_READ_ONLY_OPTIMAL after storage writes, then restore GENERAL before attachment or storage use. The behavior is distinct from this PR, but both change MultisampleTarget::Sampled and the borrowed Texture view path. The layout update needs to preserve the array viewType and cache key here. No urgency; could you advise whether you prefer #6635 to land first so I can rebase the layout fix onto it, or the layout fix to go first so you can rebase this PR? I have not opened the follow-up yet.

@hamb3r

hamb3r commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for checking, @MarcZX100!

It would be great if #6635 lands first since it's already approved and ready for the maintainers. If you don't mind holding off on opening yours until it's merged, that will prevent any unnecessary conflicts.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 16, 2026
@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks for the guidance. I had opened #6971 shortly before seeing your reply, after #6683’s author confirmed that either order was workable. I have now marked #6971 as draft to avoid parallel review/merge conflicts. Once #6635 lands, I’ll rebase it and recheck the array-view/cache-key integration before marking it ready.

@hamb3r

hamb3r commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

Hi @adriadam10 @oneandonlydean, hope you're doing well! Just bumping this so it doesn't get lost in the backlog. The changes are purely focused on optimizations, all checks are passing, and there are no merge conflicts. Would love to get your eyes on it when you have a few minutes!

@Amoenus

Amoenus commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Refining this report after checking the shader type and specification: FetchProgram(arrayed) uses Sampled=1, yet explicitly emits ImageMSArray. That capability is for multisampled array storage images (Sampled=2) in the SPIR-V specification. The more portable proposed correction is to remove the unnecessary if (arrayed) module.EmitCapability(spv::CapabilityImageMSArray); declaration, preserving the sampled-array type and fetch.

I compiled an independent usampler2DMSArray texelFetch control with the installed glslang for Vulkan1.2: it emits only OpCapability Shader, with OpTypeImage %uint 2D 0 1 1 1 Unknown, and passes spirv-val --target-env vulkan1.2. This confirms the capability boundary; the actual native-depth fixture still needs a hardware rerun with that declaration removed. The actual fixture is now validated below after that replay finished.

Earlier hardware control: our main55 integration with the older #6635 array-view work and #7233 completion proof emitted54 VUID08740 errors per GPU in the native clear/refusal groups repeated3x. Enabling the host storage-MSAA feature eliminated those errors, with both groups3/3 on RTX5080 (32.0.16.1062) and AMD Radeon Graphics (32.0.21036.18), Windows11 Enterprise26200 / Khronos1.4.363. That control satisfies the declared capability, but introduces an unnecessary feature prerequisite and is not the preferred portable fix. Linux/lavapipe passed its available cases; no Linux validation layer is available.

These are integration/control results, not execution of unchanged latest head ebc6ea3. No production feature-negotiation change is proposed. The separate command-pool reset issue remains #7311. AI-assisted: Codex; author responsible.

Actual fixture validation completed: focused one-line capability removal9e17f1522 is in integration4c2cab/main5de. The prior host-feature addition is reverted. Both native clear/refusal groups pass3/3 on each physical GPU with Khronos1.4.363 loaded and zero observed VUIDs, while the available Linux cases also pass3/3. Broader volume/packed-color/publication controls pass in that same composition. This validates the sampled-only correction on our composition, not unchanged latest #6635 head. Please prefer this capability removal to the earlier feature-enabling control.

…-descriptor-shape

# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
#	core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@MarcZX10

Copy link
Copy Markdown
Contributor

I checked the current head ed85bd05c: FetchShader(arrayed) no longer emits CapabilityImageMSArray, so the capability concern in the review appears addressed in source. The reported native-depth execution was on the earlier 026e69fa6 head, and this current head's hosted build/test jobs are skipped. Could you confirm the focused agc_driver_native_multisample_depth test passes on ed85bd05c after the capability removal?

@hamb3r

hamb3r commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

@Amoenus Thank you for the thorough SPIR-V specification breakdown (Sampled=1 vs Sampled=2) and the multi-GPU control validation. We aligned with that portable direction: head ed85bd05c removes the unnecessary if (arrayed) module.EmitCapability(spv::CapabilityImageMSArray); declaration in FetchShader directly, avoiding any extra host feature prerequisites.

@MarcZX100 Confirmed: executed the focused agc_driver_native_multisample_depth test directly on head ed85bd05c on physical hardware:

  • Host: AMD Ryzen 7 7700, NVIDIA GeForce RTX 3080 (driver 560.94 / 2588114944), Windows 10 Pro (Build 19045).
  • Execution: 100% passed (12/12 cases checked, 0 unavailable, 0.41s).
  • Validation Layer (VK_LAYER_KHRONOS_validation): clean pass with 0 validation errors / 0 VUIDs; VUID-VkShaderModuleCreateInfo-pCode-08740 is completely resolved.
ctest -R agc_driver_native_multisample_depth -V output (with Khronos validation layer)
test 608
    Start 608: agc_driver_native_multisample_depth

608: Test command: E:\AnyPS5_original\build-portable\tests\agc_driver_native_multisample_depth_tests.exe
608: Working Directory: E:/AnyPS5_original
608: Environment variables: 
608:  ANYPS5_NO_SHADER_CACHE=1
608:  APS5_NO_PIPELINE_JOURNAL=1
608: Selected GPU name=NVIDIA GeForce RTX 3080 vendor=0x10de device=0x2206 driver=2588114944
608: [src/VulkanDevice.cpp:1119 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 3080 vendor=0x10de device=0x2206 subgroup=32
608: [src/VulkanDevice.cpp:1527 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
608: [src/VulkanDevice.cpp:1892 VulkanDevice] Vulkan device ready device=0000020f00ae00d0 queue=0000020f003a41d0 family=0
608: Native depth feedback refused through the draw resource path
608: Native depth format=124 samples=2 clear=0: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=124 samples=2 clear=1: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=124 samples=2: binds over the owner's HTILE left its words alone
608: Native depth format=124 samples=4 clear=0: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=124 samples=4 clear=1: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=124 samples=4: binds over the owner's HTILE left its words alone
608: Native depth format=124 samples=8 clear=0: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=124 samples=8 clear=1: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=124 samples=8: binds over the owner's HTILE left its words alone
608: Native depth format=126 samples=2 clear=0: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=126 samples=2 clear=1: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=126 samples=2: binds over the owner's HTILE left its words alone
608: Native depth format=126 samples=4 clear=0: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=126 samples=4 clear=1: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=126 samples=4: binds over the owner's HTILE left its words alone
608: Native depth format=126 samples=8 clear=0: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=126 samples=8 clear=1: imported, rasterized twice, sampled and refused conflicts
608: Native depth format=126 samples=8: binds over the owner's HTILE left its words alone
608: Native depth eligibility, guest writes, queued writes, metadata transitions and held views checked
608: Native multisampled depth cases checked=12 unavailable=0
1/1 Test #608: agc_driver_native_multisample_depth ...   Passed    0.41 sec

The following tests passed:
	agc_driver_native_multisample_depth

100% tests passed, 0 tests failed out of 1

@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks for rerunning the current head. The 12/12 focused native-depth cases with no validation-layer errors on the capability-removal head answer the current-head validation request; the earlier host-feature workaround is unnecessary. I have no further request on this capability issue.

@oneandonlydean oneandonlydean self-assigned this Oct 18, 2026
@oneandonlydean
oneandonlydean merged commit ca1c4c8 into boykopovar:main Oct 18, 2026
9 checks passed
oneandonlydean pushed a commit that referenced this pull request Oct 21, 2026
Resolves MultisampleTarget against #6635: the sampled view takes the requested view type and keeps the sampled-only usage when the target has a storage view for the guest's sample order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants