fix(agc): give storage image table elements UINT views when their kind needs one #18455
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18455"
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 Pipodi on 2026-11-11T15:22:32Z.
What
A storage image table element that the shader only writes as raw uint (written-only R16_FLOAT, R16_SINT, R32_SINT) got its native view instead of the UINT view, so the raw uint store hit a format mismatch.
The driver chooses the UINT view of such an image from the binding number (
RuntimeAbi::UintStorageImageBinding). The storage image table is binding 260, outside the uint slots, so every table element was bound withStorageView(..., false)while the shader stored uint through the kind's typed array.DescriptorBinding::imageUintStorage: one flag per table element, true when the element's kind is a uint storage kind. Built inDescriptorBindingBuilder::Populate(reserved with the other per-element arrays), serialized in the shader disk cache (FormatVersion88;DescriptorBindingsize check 864 -> 920).ShaderResources::storageUintkeeps it next tostorageAtomic64; both table write sites OR it into theStorageViewargument.docs/dev/debt/changes/fix-agc-storage-table-uint-views.md.Overlap: #18185 (@hamb3r, D16S8 depth conversion) carries the same
imageUintStorageflag, encode/decode and Populate line as part of a larger change. Whichever merges second has to drop the shared lines; see the comment below.Tested
Windows 11, NVIDIA GeForce RTX 4090 (driver 617.42), host tests only, no title. Branch head
4f13ee9e6con main6453229902.agc_driver_image_tablecase (RunStoreUintViewTests) stores through a table element of written-only R16_FLOAT (f16 store, expects 0x3e00 and untouched padding), R16_SINT and R32_SINT (raw uint). On main plus only the test commit (0839d13e27) it fails:image table store: written-only R16_FLOAT descriptor wrote the wrong texel or padding 0. With the fix it passes.verifyImageTableUintStorage(agc_shader_memory): flag set for written-only R16_FLOAT, R16_SINT, R32_SINT; clear for R32_UINT and R8G8B8A8_UNORM table elements. It does not compile on main (noimageUintStorage).agc_shader_table_binding_growth(failed in this PR's Windows CI at 11 allocations against a ceiling of 10): the new per-element array is now reserved with the others and the ceiling counts it (8 image arrays + 2 sampler arrays + 1 spill = 11); the test also checks the flag count. It passes on main (10) and on the branch.b93d4a14d1on main6c9a7b6f8a): 5720 of 5721 pass. On4f13ee9e6cthe focused set (table binding growth, shader memory, image table, storage image, descriptor, disk cache) passes 53/53. The one not run isagc_driver_upload_cache_read_only_flush: main'sUploadCacheReadOnlyFlush.cpp:177usessetenv, which does not build with MinGW (#19899), on main as well.4f13ee9e6c:ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer VK_KHRONOS_VALIDATION_REPORT_FLAGS=error,warn ctest --test-dir build -R "agc_driver_(image_table|nested_image_table|image_store|format_d16|d16_memory|runtime_formatted_store|pixel_float16_store|image_packed16)" -V(55 tests pass). The log shows[Vulkan Loader] INFO | LAYER: Insert instance layer "VK_LAYER_KHRONOS_validation" (C:\VulkanSDK\1.4.363.0\Bin\VkLayer_khronos_validation.dll); nowas not found but was requested,VUID-orSYNC-HAZARD. Main (0839d13e27, earlier run, same command) fails only the new case.Checklist
main; overlaps #18185 on theimageUintStorageflag (see above)NotImplemented_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-12T14:26:30Z.
Review: COMMENTED
Reviewed — no blocking findings
The change gives storage image table elements that need a UINT view one, and the code I read matches the stated goal; one PR description sentence disagrees with the test.
What I ran
749818da2d31f74adf82b8757e67640dc6b054a1, basemain.diff.patch) for all 10 changed files, and the manifest.Results
storageTexturespush has a matchingstorageUintpushIrProgram.cppverifyImageTableUintStorageagc_driver_image_tableGPU caseReader output, abridged
Every storage texture push in
ShaderResources.cpp(lines 5911, 5934, 5935, 6394) has onestorageUintpush beside it.UintStorageImageBinding(RuntimeAbi.hpp113–118) covers local slots 36–42, which are the storage uint kinds inIrProgram.cpp986–988.Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:6209: the test expects the UINT flag to be true forTableFormat32UInt. The PR text says it is clear for R32_UINT. The code agrees with the test, because the uint kinds include R32_UINT. This is harmless, since the UINT view of an R32_UINT element is the same format. Fix the PR description so it says the flag is set for R32_UINT too.Not verified
storeHalf(12u, uintCode, 0x8000u, ...)incore/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp. I could not derive0x8000from the0x89abcdefliteral and the store word in the test. Confirm it when the case runs.StorageTexture::StorageView(Texture.cpp:2361) throwsstd::runtime_errorwhen the device has no UINT view format. The table rejection depends on it, and I did not read that function.ShaderResources.cpp,ShaderMemory.cppandImageTable.cpp. Those files are too large for the review folder, so I used the diff hunks and reader context only. I did not readfiles/.FormatVersion87 against the open PRs that claim 69–86. This is coordination, not code.To get this to a good state
0x8000expectation on the next GPU run.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T02:44:10Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at head
81362e7b90b64ceac5e0a4032ee4a14809054240appears sound; no checks were run during this review, and the evidence inspected supports merging.What I ran
No commands or tests were run. I reviewed the prepared diff and targeted source ranges at the pinned head.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The change appears internally consistent: table elements carry the kind-derived UINT view flag, both descriptor write paths use it, and table resolution creates the requested view to trigger the existing rejection path when unsupported. Disk-cache encoding and decoding include the new field, with the format version incremented. The changed GPU and recompiler tests were reviewed but not run. The author-reported Windows/NVIDIA results were not independently verified.
Read:
description.md,commits.md,manifest.json,diff.patch,README.md, and relevant ranges from all changed files, including the two excluded from the prepared file bundle (ShaderResources.cppandShaderMemory.cpp). The remaining lines in those changed files were not read.To get this to a good state
Nothing is required.