Skip to content

Commit

Permalink
apple: enable emulated mailbox (#17506)
Browse files Browse the repository at this point in the history
  • Loading branch information
warmenhoven authored Feb 2, 2025
1 parent 212ae55 commit 089a51f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gfx/common/vulkan_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define VENDOR_ID_NV 0x10DE
#define VENDOR_ID_INTEL 0x8086

#if defined(_WIN32)
#if defined(_WIN32) || defined(__APPLE__)
#define VULKAN_EMULATE_MAILBOX
#endif

Expand Down Expand Up @@ -698,12 +698,16 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
&vk->context.memory_properties);

#ifdef VULKAN_EMULATE_MAILBOX
#if defined(_WIN32)
/* Win32 windowed mode seems to deal just fine with toggling VSync.
* Fullscreen however ... */
if (vk->flags & VK_DATA_FLAG_FULLSCREEN)
vk->flags |= VK_DATA_FLAG_EMULATE_MAILBOX;
else
vk->flags &= ~VK_DATA_FLAG_EMULATE_MAILBOX;
#else
vk->flags |= VK_DATA_FLAG_EMULATE_MAILBOX;
#endif
#endif

/* If we're emulating mailbox, stick to using fences rather than semaphores.
Expand Down

0 comments on commit 089a51f

Please sign in to comment.