fix(shader): declare lock-emulated 64-bit atomic images as Rg32ui #21749
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21749"
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 androidbaklava on 2026-11-16T18:26:57Z.
What
Since #18842,
agc_driver_image_atomics64fails on every run on an Intel UHD iGPU on Windows:This driver has neither
shaderImageInt64AtomicsnorshaderStorageImageReadWithoutFormat, so every 64-bit image atomic (and every program holding one) is refused, where before #18842 the test skipped.The lock emulation always binds the image through an
R32G32_UINTview (StorageTexture::AtomicView, andPlaceholderImageShapeForDevicefor the placeholder), and reads and writes it as twouintcomponents. The image type no longer leaves its formatUnknown: a lock-emulated 64-bit atomic image is declaredRg32ui, which needsStorageImageExtendedFormatsinstead ofStorageImageReadWithoutFormatandStorageImageWriteWithoutFormat. Vulkan allows that capability without a feature,VulkanDevice'sCoreVulkanCapabilityalready accepts it, andR32G32_UINTstorage images are mandatory.ShaderValidationnow accepts it too. Devices withshaderImageInt64AtomicskeepR64ui.agc_shader_memory_testscompiled the lock path with both formatless capabilities in the device list, so a device without them was never covered. They are dropped from that list, and the test now checks that the lockedimage_atomic_swapdeclaresStorageImageExtendedFormatsand neither formatless capability. Without this change the test fails with the error above.The
64-bit image atomicsentry indocs/dev/debt/shader.mdis changed through a fragment to name Intel's Windows driver and this measurement.Tested
Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON,mained957ca35c.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R '^agc_driver_(image_atomics64|buffer_atomics_or_swap64|buffer_atomics_inc_dec64)$' -V, 3 runs each, rebuilding in between:agc_driver_image_atomics64agc_driver_buffer_atomics_or_swap64agc_driver_buffer_atomics_inc_dec64VUID-linesmainWith this PR
agc_driver_image_atomics64runs every case on this GPU: all operations on 32_32 UINT, SINT and FLOAT images and 2,048 contendedimage_atomic_addandimage_atomic_umaxon one texel in wave32 and wave64, all exact. Every log showsInsert instance layer "VK_LAYER_KHRONOS_validation"and none showswas not found but was requested.agc_shader_memory_tests(default mode): fails onmain's recompiler with the tightened test, passes with this PR.ctest -R 'atomic|^agc_shader|placeholder': 108 of 108 pass; the skips are the same as onmain. To buildmainon Windows I applied #19899's_putenv_schange toUploadCacheReadOnlyFlush.cpplocally; it is not part of this PR.Not tested on MoltenVK, where
shaderStorageImageReadWithoutFormatis present and the declared format changes fromUnknowntoRg32uiover the sameR32G32_UINTview.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)8086:a7a8), Intel driver 101.7084, Windows 11Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T11:29:57Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the inspected code supports the stated fix, but one changed test file was not fully reviewed.
What I ran
Inspected the prepared diff for head
e4e7ad54a82640801e64837c210dcdea66b98012, the PR description and manifest, and targeted code at the pinned head usingrepo_read.py.No build or tests were run. I read the full changed lines and surrounding code for
ShaderValidation.cpp,SpirvDescriptors.cpp, andSpirvModuleSetup.cpp; forShaderMemory.cpp, I read the changed lines and the surroundingverifyInt64AtomicCapabilitiesfunction range. I also inspected targeted Vulkan capability, atomic-emission, image-view, and related test code.ShaderMemory.cppwas excluded from the review folder because it was too large; it was accessed through the reader for the relevant range.Results
Findings
Blocking
None identified in the code inspected.
Non-blocking
None.
Not verified
ShaderMemory.cppfile was not read; only the changed lines and relevant function range were inspected.docs/dev/debt/changes/fix-agc-image-atomics64-typed-locks.mdwas not reviewed.To get this to a good state
Nothing is required.