Skip to content

Commit b9cda7b

Browse files
ro8inmorganJoeMatt
authored andcommitted
Fix for vulkan_create_swapchain() not clearing flag (fixes random crashes with fast forwarding) (libretro#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 (libretro#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 af8a41a commit b9cda7b

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
@@ -2337,7 +2337,9 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
23372337

23382338
if (vk->flags & VK_DATA_FLAG_EMULATING_MAILBOX)
23392339
vulkan_emulated_mailbox_init(&vk->mailbox, vk->context.device, vk->swapchain);
2340-
2340+
2341+
/* This flag needs to be cleared otherwise elsewhere it can be perceived as if there's a new swapchain created everytime its being called */
2342+
vk->flags &= ~VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN;
23412343
return true;
23422344
}
23432345

0 commit comments

Comments
 (0)