shader_recompiler: Fix some shared memory accesses when workgroup struct is omitted. (#3110)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled

This commit is contained in:
squidbus 2025-06-17 00:28:44 -07:00 committed by GitHub
parent efa8f6a154
commit 5bc4cc761a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 30 deletions

View file

@ -203,6 +203,14 @@ public:
return final_result;
}
Id EmitSharedMemoryAccess(const Id result_type, const Id shared_mem, const Id index) {
if (std::popcount(static_cast<u32>(info.shared_types)) > 1) {
return OpAccessChain(result_type, shared_mem, u32_zero_value, index);
}
// Workgroup layout struct omitted.
return OpAccessChain(result_type, shared_mem, index);
}
Info& info;
const RuntimeInfo& runtime_info;
const Profile& profile;