Repository navigation
fix(agc): write a single-slice 1D-array T# through a DIM 1D storage binding - #25151
oneandonlydean merged 1 commit into
Conversation
…inding A storage image whose shader shape is 1D and whose T# is a 1D array was refused with "guest storage texture dimension disagrees with the shader's declared image shape (shape 0, dimension 5)": the storage path narrowed only a 2D shape over a 2D array to its base slice. When the 1D array's base and last slices are equal, the access can only address that slice, so the binding now uses a 1D first-layer view of it (StorageTexture::createView gains the 1D view). A 1D array of more than one slice still throws, since where a DIM 1D store lands there is not measured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
NVIDIA run: the new test passes and the image store and array tests do not regress. Setup: RTX 3070 8 GB, NVIDIA 610.57.04, Ryzen 5 5600X, Debian 13 (kernel 6.12.115), GCC 13.3.0 Release, validation layer 1.4.335. Base is the merge-base e60b2f7, head is 1fbeda1.
Every run selects the RTX 3070; every Vulkan test's log shows the layer inserted, none reports it missing, and no log has a AI-assisted: yes |
|
Windows Intel check on a physical Intel UHD Graphics
The new test reached its final success marker after checking the full readback of both |
|
A Windows + NVIDIA run of the current head 1fbeda1. The earlier runs were AMD on Windows, NVIDIA on Linux and Intel on Windows. No regressions, and the new test passes. System: Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 4060 (10de:2882, Ada), driver 621.01, Intel Core i5-12400F, WinLibs GCC 15.2.0 r7 (UCRT), Release, Trees, each a full build:
Run:
With this PR,
The layer was inserted 1886 times on main and 1887 with this PR. There are 0 Not tested: a title, and multi-slice 1D arrays beyond the refusal case the new test already checks. AI-assisted: yes (Claude Code). It merged the PR, ran the three builds and the test sets, and drafted and posted this comment. |
MarcZX10
left a comment
There was a problem hiding this comment.
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 in ShaderResources.cpp, Texture.cpp, ImageStoreLineThroughLineArraySlice.cpp, and fix-agc-1d-array-single-slice-storage.md, plus the storage-view call sites in ShaderResources.cpp and Texture.cpp.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | No concrete defect found in the reviewed changes. |
| Focused tests | not run | The reported RX 6800 results were not independently verified. |
| Console behavior | not run | The reported Forza Horizon 5 runs were not independently verified. |
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.cpp and Texture.cpp were 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.
|
Windows AMD run of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, AMD Radeon RX 6700 XT, driver 32.0.21045.29003.
AI-assisted: yes. |
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/maine60b2f7.Focused AGC image and shader memory tests (
^agc_driver_image|^agc_shader_memory$) onmaine60b2f7 and on this branch (1fbeda1), 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:maine60b2f7agc_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 feat(shader): flatten oversized 1D image arrays to 2D #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 (feat(agc): retain and refresh sampled depth array storage #1368, perf(libSceAgcDriver): keep storage surfaces tracked around unwatching host imports #4448, perf(agc): import storage surfaces that cross the import window through a joined import #6197, feat(agc): back extra guest mip levels with storage images #7085, fix(agc): keep per-layer storage views of a 2D array in one image #10743, perf(agc): take an aliased storage image's units on the device without a host import #13251, perf(agc): one storage image for a 2D surface and its one-slice 2D array descriptor #13796, feat(agc): reuse unchanged untracked storage snapshots #13809, fix(agc): target storage flush waits by writer lane #13920, feat(shader): flatten oversized 1D image arrays to 2D #14871, fix(agc): drop pending storage results over memory the guest unmapped #22018) diff-checked; none implements DIM 1D storage bindings over a single-slice 1D array. (fix(agc): read 1D-array T#s through DIM 1D from their base slice #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:maine60b2f7 + fix(agc): read 1D-array T#s through DIM 1D from their base slice #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).maine60b2f7 + fix(agc): read 1D-array T#s through DIM 1D from their base slice #23688 + fix(libkernel): set guest errno on failure in sceKernel file calls #24960 + fix(agc): apply the pending CMASK clear in a fast-clear eliminate of a multisampled target #24993 + fix(agc): claim multisampled memory in a CB metadata pass over a single-sample target #24994 + fix(agc): support four-fragment compressed FMASK #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 VUIDs