fix(shader): leave the workgroup memory set out of a compute module's bindings #11951
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11951"
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 BunnyFl on 2026-10-27T13:46:54Z.
What
A compute shader whose LDS plus 4 bytes is larger than the device's
maxWorkgroupSharedMemoryByteskeeps its LDS in a storage buffer declared in descriptor set 1, binding 0 (WorkgroupMemoryDescriptorSet).buildSpecializedModulelists the binding number of every descriptor variable that remains after specialization and left out only the pixel function LDS set (set 2), so it listed that buffer as binding 0.DescriptorBindingBuilder::Selectthen looks the module's binding numbers up in the prepared plan, which holds only set 0. When the shader has guest buffers, set 0's binding 0 (Buffers) is there and the lookup succeeds by number. When it has none, the recompile fails withspecialized module bindings disagree with the prepared plan.This leaves the variables of
WorkgroupMemoryDescriptorSetout for aGLComputeentry point, as the pixel function LDS set already is. Set 1 is alsoFragmentDescriptorSet, so pixel shaders keep listing their set 1 bindings.Tested
Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release,
BUILD_TESTING=ON, onmain75f3702aed:agc_lds_lock_budget: a compute program with one image load, 16 dwords of LDS stored withds_write_b32and no buffers, compiled for a 64-byte shared memory limit. It checks that the program compiles, that its LDS is in device memory (workgroupMemoryDwords == 18) and that it was specialized. It passes in three runs; with onlyRecompiler.cppput back tomain's version, it fails in all three runs withspecialized module bindings disagree with the prepared plan. The 12 existing cases pass in both. The runs setANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation; the test only recompiles and creates no Vulkan device, so neither log has aVUID-line or a missing-layer message.tools/check_conventions.py --base upstream/mainpasses.Planet Zoo (PPSA18026 01.009.002), AMD Radeon RX 9070 XT (
maxComputeSharedMemorySize32768, driver 32.0.32015.7029):mainaborts before any frame withcompute shader 0xb401f08800: specialized module bindings disagree with the prepared plan: 55 and 46 s in on3fea2a937b, 49 s in on8ff4baf534. That shader uses 8192 dwords of LDS and no buffers. Its request, saved withAPS5_DUMP_SHADERS, fails the same way inagc_shader_replaywithmain'sRecompiler.cppand recompiles with this change (on62b3ba2522too), as do the other nine requests saved in that run.8ff4baf534, the title no longer aborts there. In one run it showed the Frontier logo and the EULA screen (288 presents before a timedAPS5_HANG_DUMP_SECSdump at 60 s). In two other 300 s runs its log stopped after about 80 s and 30 s, with 3 and 0 presents; that stop is not investigated here.Rebased onto
main08a10d2253(head40775bc85a).mainhad addedMeshWindowDescriptorSetto the same condition (6f79055a00); the rebased line keeps it next to this change's compute-onlyWorkgroupMemoryDescriptorSet. On that head, same machine and compiler (these runs did not set the Vulkan variables above):agc_lds_lock_budgetpasses in three runs; with onlyRecompiler.cppput back tomain's version it fails in all three withLDS lock budget: specialized image program without buffers: ShaderRecompiler::Recompile: specialized module bindings disagree with the prepared plan.tools/check_conventions.py --base upstream/mainpasses.disagree with the prepared planline; the run stopped at the time cap, not by itself. The same title onmain99b571f879aborted 49 s in with that error.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