Vulkan overlay: use the corresponding image index for each swapchain

pImageIndices should be a pointer to the current image index
otherwise every swapchain but the first one could have a wrong image index
pull/28/head
Georg Lehmann 4 years ago committed by jackun
parent b2f20f02d2
commit 7a4ffe8206
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -2195,15 +2195,18 @@ static VkResult overlay_QueuePresentKHR(
struct swapchain_data *swapchain_data =
FIND(struct swapchain_data, swapchain);
uint32_t image_index = pPresentInfo->pImageIndices[i];
before_present(swapchain_data,
queue_data,
pPresentInfo->pWaitSemaphores,
pPresentInfo->waitSemaphoreCount,
pPresentInfo->pImageIndices[i]);
image_index);
VkPresentInfoKHR present_info = *pPresentInfo;
present_info.swapchainCount = 1;
present_info.pSwapchains = &swapchain;
present_info.pImageIndices = &image_index;
uint64_t ts0 = os_time_get();
result = queue_data->device->vtable.QueuePresentKHR(queue, &present_info);
@ -2215,11 +2218,13 @@ static VkResult overlay_QueuePresentKHR(
VkSwapchainKHR swapchain = pPresentInfo->pSwapchains[i];
struct swapchain_data *swapchain_data =
FIND(struct swapchain_data, swapchain);
uint32_t image_index = pPresentInfo->pImageIndices[i];
VkPresentInfoKHR present_info = *pPresentInfo;
present_info.swapchainCount = 1;
present_info.pSwapchains = &swapchain;
uint32_t image_index = pPresentInfo->pImageIndices[i];
present_info.pImageIndices = &image_index;
struct overlay_draw *draw = before_present(swapchain_data,
queue_data,

Loading…
Cancel
Save