diff options
author | Doug Horn <doughorn@google.com> | 2022-08-04 10:59:54 -0700 |
---|---|---|
committer | Doug Horn <doughorn@google.com> | 2022-08-08 19:27:03 +0000 |
commit | 6f47753a84b54ac671e13914c93513164234ddba (patch) | |
tree | 39a5a63e64ab8db35be15e33975072b08aef3c92 | |
parent | e306172d16b27184d416f322d4690c7c08c0841e (diff) | |
download | gfxstream-protocols-6f47753a84b54ac671e13914c93513164234ddba.tar.gz |
Spinlocks should have a pause emitted.
Bug: NONE
Test: Run the script
Change-Id: I624cf24ae24bbc2a0db0d51f8ed9a030821c3668
-rw-r--r-- | registry/vulkan/scripts/cereal/decoder.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/registry/vulkan/scripts/cereal/decoder.py b/registry/vulkan/scripts/cereal/decoder.py index 961f2524..3fa2a65f 100644 --- a/registry/vulkan/scripts/cereal/decoder.py +++ b/registry/vulkan/scripts/cereal/decoder.py @@ -744,7 +744,13 @@ class VulkanDecoder(VulkanWrapperGenerator): if (queueSubmitWithCommandsEnabled && ((opcode >= OP_vkFirst && opcode < OP_vkLast) || (opcode >= OP_vkFirst_old && opcode < OP_vkLast_old))) { uint32_t seqno; memcpy(&seqno, *readStreamPtrPtr, sizeof(uint32_t)); *readStreamPtrPtr += sizeof(uint32_t); if (seqnoPtr && !m_forSnapshotLoad) { - while ((seqno - __atomic_load_n(seqnoPtr, __ATOMIC_SEQ_CST) != 1)); + while ((seqno - __atomic_load_n(seqnoPtr, __ATOMIC_SEQ_CST) != 1)) { + #if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) + _mm_pause(); + #elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) + __asm__ __volatile__("pause;"); + #endif + } } } """) |