fix(agc): write a single-slice 1D-array T# through a DIM 1D storage binding #25151
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25151"
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 birdmarty on 2026-11-21T17:54:06Z.
What
Allow a DIM 1D storage image binding over a single-slice 1D-array
T#(BASE_ARRAY == lastArraySlice) by binding a 1D first-layer view of that slice.Previously,
ShaderResources::resolveImageBindingnarrowed only a 2D storage binding over a 2D array to its base slice, so a DIM 1D storage binding over a 1D-arrayT#threwguest storage texture dimension disagrees with the shader's declared image shape (shape 0, dimension 5). #23688 handles DIM 1D sampled reads and loads of 1D arrays (measured on gfx1036 to read sliceBASE_ARRAY), while stores were not measured. When a 1D array has only one slice (baseArray == depthOrLastArray), a DIM 1D store can only address that slice, so narrowing it to a 1D first-layer view is unambiguous without a multi-slice hardware measurement. A 1D array with more than one slice still throws.Changes
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp: extend the storage binding'sfirstLayercheck inShaderResources::resolveImageBindingto acceptDescriptorImageShape::Image1DoverTextureDimension::k1DArraywhenresource.baseArray == resource.depthOrLastArray.core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp: allowStorageTexture::createViewto create aVK_IMAGE_VIEW_TYPE_1Dfirst-layer view over ak1DArraysurface.core/libs/prx/libSceAgcDriver/tests/execution/ImageStoreLineThroughLineArraySlice.cpp: addagc_driver_image_store_line_through_line_array_slice, checking that a DIM 1Dimage_storethrough a single-slice 1D-arrayT#(32_SINTand32_32_32_32_SINT) writes every texel and leaves trailing bytes untouched, and that the same store through a two-slice 1D array is still refused.docs/dev/debt/changes/fix-agc-1d-array-single-slice-storage.md: document1D stores to single-slice 1D arraysand that multi-slice 1D arrays remain refused pending hardware measurement.Tested
Windows 11 Pro (build 26300), Intel Core i9-9900K, MinGW-w64 GCC 15.3.0, Release build with tests, AMD Radeon RX 6800 (vendor
0x1002, device0x73bf, AMD proprietary driver 26.10.1 / Windows driver 32.0.21045.16010, Vulkan 1.4.315), based onorigin/maine60b2f74ad.Focused AGC image and shader memory tests (
^agc_driver_image|^agc_shader_memory$) onmaine60b2f74adand on this branch (1fbeda1ffd), same machine and GPU, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan SDK 1.4.363.0) andVK_LOADER_DEBUG=layer:maine60b2f74ad1fbeda1ffd)agc_driver_image_store_line_through_line_array_slice)agc_driver_image_array_rows_past_layer_limit,agc_driver_image_array_window_past_layer_limitInsert instance layer "VK_LAYER_KHRONOS_validation"VUID-linesmain'sShaderResources.cppandTexture.cppbuilt with this branch's test):agc_driver_image_store_line_through_line_array_slicefails withAGC graphics: guest storage texture dimension disagrees with the shader's declared image shape (shape 0, dimension 5).py -3 tools/check_conventions.py --base origin/mainandpy -3 tools/debt_fold.py --check: both passed.py -3 tools/pr_overlap.py --branch fix/agc-1d-array-single-slice-storage(2,238 open PRs): 116 share files; among mergeable PRs, only #14871 (feat(shader): flatten oversized 1D image arrays to 2D) touches neighbouring context aroundfirstLayerinShaderResources.cpp(unrelated). The 49 conflicted PRs could not be compared automatically and were checked by title, with the 11 array/storage/view PRs (#1368, #4448, #6197, #7085, #10743, #13251, #13796, #13809, #13920, #14871, #22018) diff-checked; none implements DIM 1D storage bindings over a single-slice 1D array. (#23688 covers DIM 1D reads only and touches independent code.)Title test: Forza Horizon 5 (PPSA22327 v01.685.672, same machine): compute shader
0x7f5d100writes a single-slice 1D-arrayT#(width 8, format 20, linear, slices 0..0, 1 mip) through a DIM 1D storage binding:maine60b2f74ad+ #23688 + open PRs): stopped withcompute shader 0x7f5d100: AGC graphics: guest storage texture dimension disagrees with the shader's declared image shape (shape 0, dimension 5).1fbeda1ffd, without diagnostics, onmaine60b2f74ad+ #23688 + #24960 + #24993 + #24994 + #23545 / 4x FMASK) ran 68.5–75.0 s (~909–1,002 frames presented) to a later unrelated stop; the later runs added more open PRs on top, and the first 7 runs used an earlier commit with the same source change.Not tested: multi-slice 1D arrays (still refused), other GPUs, Linux/macOS host builds, console hardware.
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)mainand this change, 0 VUIDsImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T07:24:20Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
1fbeda1ffd8be8c4e5eda298a8a8e7e12877dbb7. I did not run commands or tests; the test results below are author-reported. I read the changed lines inShaderResources.cpp,Texture.cpp,ImageStoreLineThroughLineArraySlice.cpp, andfix-agc-1d-array-single-slice-storage.md, plus the storage-view call sites inShaderResources.cppandTexture.cpp.Results
Negative control
Not run by me. The description reports that the new test failed against the unmodified implementation with a dimension mismatch.
Findings
Blocking
None.
Non-blocking
None.
Sources
The change permits first-layer storage views for a 1D array only when its base and last slices are equal, and selects a 1D Vulkan view for that case. The storage binding path carries this flag into view selection. ShaderResources.cpp at the reviewed head · Texture.cpp at the reviewed head
Not verified
I did not independently run the build, focused tests, convention checks, debt check, or title test. Other GPUs, host operating systems, console hardware, and multi-slice DIM 1D stores were not verified. All four changed files were reviewed;
ShaderResources.cppandTexture.cppwere read through the pinned repository reader because their full text was excluded from the review folder. No changed files were excluded from review.To get this to a good state
Nothing is required. Optional: independently run the focused tests and confirm the reported hardware behavior.