mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
SPIRV-Cross emits the lock's acquire compare-exchange and release exchange as relaxed Metal atomics, so the plain LDS loads and stores of a locked 64-bit update were not ordered against the lock and contended ds_add_u64 lost updates on an Apple M5 Pro. On MoltenVK the driver now sets SpirvTarget::ldsLockFences, and the lock brackets its critical section with workgroup-scope acquire and release OpMemoryBarriers, which become threadgroup atomic_thread_fence with no execution barrier. Co-Authored-By: Claude Opus 5.5 <[email protected]>