1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-29 17:52:18 +01:00

[util] Implement spin on ARM64

This commit is contained in:
Joshua Ashton 2022-09-13 18:50:19 +01:00 committed by Joshie
parent 57cee691b3
commit 2218462ff2

View File

@ -21,7 +21,13 @@ namespace dxvk::sync {
void spin(uint32_t spinCount, const Fn& fn) {
while (unlikely(!fn())) {
for (uint32_t i = 1; i < spinCount; i++) {
#if defined(DXVK_ARCH_X86)
_mm_pause();
#elif defined(DXVK_ARCH_ARM64)
__asm__ __volatile__ ("yield");
#else
#error "Pause/Yield not implemented for this architecture."
#endif
if (fn())
return;
}