aboutsummaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
authorGeorg Lehmann <[email protected]>2020-02-06 22:38:35 +0100
committerMarge Bot <[email protected]>2020-02-10 11:32:08 +0000
commit7283c33b981f975361e3bfa62a339c88f2642cbb (patch)
tree9f51b6effac93a0b28131d2e1435c2779c233056 /src/vulkan
parenteb0195358c4e0376d93f10fb4f90703e51718779 (diff)
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 Cc: <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3741> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3741>
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/overlay-layer/overlay.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vulkan/overlay-layer/overlay.cpp b/src/vulkan/overlay-layer/overlay.cpp
index d720dd192eb..565f5884bb6 100644
--- a/src/vulkan/overlay-layer/overlay.cpp
+++ b/src/vulkan/overlay-layer/overlay.cpp
@@ -1903,15 +1903,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);
@@ -1923,11 +1926,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,