mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-30 11:52:11 +01:00
[util] Implement spin on ARM64
This commit is contained in:
parent
57cee691b3
commit
2218462ff2
@ -21,7 +21,13 @@ namespace dxvk::sync {
|
|||||||
void spin(uint32_t spinCount, const Fn& fn) {
|
void spin(uint32_t spinCount, const Fn& fn) {
|
||||||
while (unlikely(!fn())) {
|
while (unlikely(!fn())) {
|
||||||
for (uint32_t i = 1; i < spinCount; i++) {
|
for (uint32_t i = 1; i < spinCount; i++) {
|
||||||
|
#if defined(DXVK_ARCH_X86)
|
||||||
_mm_pause();
|
_mm_pause();
|
||||||
|
#elif defined(DXVK_ARCH_ARM64)
|
||||||
|
__asm__ __volatile__ ("yield");
|
||||||
|
#else
|
||||||
|
#error "Pause/Yield not implemented for this architecture."
|
||||||
|
#endif
|
||||||
if (fn())
|
if (fn())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user