Skip to content

Commit 05175a4

Browse files
authored
Fix for vulkan_create_swapchain() not clearing flag (fixes random crashes with fast forwarding) (#18295)
* improved vulkan_create_swapchain() to handle swapchain creation better and avoid crashes * As requested by PR review, reverted back to original create_swapchain function with only minimal changes made for this bug fix on Android only * fixed oepsie with copy paste * fixed oepsie with copy paste * Fixed random crash on Android when destroying old swapchain before new one is created with minimal changes to original vulkan_create_swapchain() function * Restored all my initial changes without all the reformatting of the code (#3) * The VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN should be cleared otherwise every call to this function can be handled as a new swapchain creation while it might not be the case, it fixes crashes on Android
1 parent 36a4c83 commit 05175a4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

gfx/common/vulkan_common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2371,7 +2371,9 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
23712371

23722372
if (vk->flags & VK_DATA_FLAG_EMULATING_MAILBOX)
23732373
vulkan_emulated_mailbox_init(&vk->mailbox, vk->context.device, vk->swapchain);
2374-
2374+
2375+
/* This flag needs to be cleared otherwise elsewhere it can be perceived as if there's a new swapchain created everytime its being called */
2376+
vk->flags &= ~VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN;
23752377
return true;
23762378
}
23772379

0 commit comments

Comments
 (0)