fix(shader): gather the BASE_ARRAY face of a cube T# with DIM 2D #23519
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23519"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-11-19T06:47:55Z.
What
image_gather4andimage_gather4_lzwith DIM 2D through a cube T# threwimage descriptor is incompatible with the static runtime image interface. The cube-face mode (#4139), which samples the T#'sBASE_ARRAYface, was offered only to loads, stores andimage_sample,_lzand_l.ResourceTracker.cpp: a gather with no LOD, bias, offset or comparison (imageSampleFlags0 or LevelZero) keepscubeFaceCompatibleset, so the image is offered the cube-face mode.ResourceMaterializer.cpp:multisamplePlaneReadalso usescubeFaceCompatible. It now requires!image.gathered, so a DIM 2D read of a 2D MSAA T# still refuses gathers as before.2D accesses through a cube T#entry lists the two gathers among the accesses that take the mode, and its throw list now says "other gathers". A new entry records the measurement.No cache format change:
cubeFaceCompatibleis an existing field.Measurement:
tools/hw-oracleon gfx1036 (PC RDNA2), point S#, 32 coordinates in [1, 2] per case. The sources were a 64x64 32_FLOAT and 32_32_32_32_FLOAT cube, and a 12-face cube array atBASE_ARRAY0, 6 and 7.image_gather4/_lzwith DIM 2D vs DIM CUBE face 0DISABLE_CUBE_WRAP1BASE_ARRAY0, 6 and 7DISABLE_CUBE_WRAP0Tested
Windows 11 Pro 10.0.26200, MinGW Release build.
ctest --test-dir build -R <pattern> -VwithANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, on an NVIDIA GeForce RTX 5080 (610.74) and an AMD Radeon(TM) Graphics iGPU (gfx1036, 32.0.21045.16010). Each log shows the loader inserting the validation layer, none reports it missing, and there are noVUID-messages.agc_driver_image_gather_face_on_cube: 32 threads gather a 16x16 8_8_8_8_UNORM cube array (12 faces,BASE_ARRAY6) with DIM 2D:image_gather4_lzof R and G must return the x and y footprint.image_gather4of B must return face 6 for all four texels.main'sResourceTracker.cppandResourceMaterializer.cpp, the test fails on both GPUs withimage descriptor is incompatible with the static runtime image interface.agc_driver_*cube*,*msaa*,*gather*,*multisample*,agc_driver_image_sample*,agc_shader_memory):mainon this machine:agc_driver_image_sample_lod_clampandagc_driver_image_sample_lod_clamp_shader_lane(known NVIDIA baseline);agc_driver_msaa_dcc_unwatch(fails 3/3 runs both with and without this change).msaa_dcc_compared_importcases skip on both GPUs.tools/pr_overlap.pycannot compareResourceMaterializer.cppagainst the PRs that conflict withmain. Among open PRs on cube-face accesses, #20982 and #22534 change cube-face stores, not gathers. Not tested on a PS5.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T07:51:27Z.
Review: APPROVED
Reviewed — looks good
Nothing in the inspected change blocks merging; the author-reported test results are not independently verified here.
What I ran
Reviewed head
b2393574c7c05b0c7f88bd2077a7ae12c8d7a861from the prepared diff and source reader. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests or build were run. The PR description reports GPU tests and hardware measurements; these were not independently verified. Read all four changed files listed in the manifest:
core/libs/prx/libSceAgcDriver/tests/execution/ImageGatherFaceOnCube.cpp,core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp,core/shader/recompiler/Optimization/src/ResourceTracker.cpp, anddocs/dev/debt/changes/fix-cube-face-gathers.md. No changed files were excluded by the manifest.To get this to a good state
Nothing is required.