summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Lehmann <dadschoorse@gmail.com>2020-02-06 22:38:35 +0100
committerDylan Baker <dylan@pnwbakers.com>2020-02-10 09:01:38 -0800
commit196a68dfbc3bbb26193f1a7b10c9dbd75338ffbb (patch)
tree00b38d10bf9efa72358c99ee4adc2239ec12eea4
parentb23a12725834bb1c82387d9883f4e36f7a3d94fd (diff)
downloadmesa-196a68dfbc3bbb26193f1a7b10c9dbd75338ffbb.tar.gz
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: <mesa-stable@lists.freedesktop.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3741> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3741> (cherry picked from commit 7283c33b981f975361e3bfa62a339c88f2642cbb)
-rw-r--r--.pick_status.json2
-rw-r--r--src/vulkan/overlay-layer/overlay.cpp11
2 files changed, 9 insertions, 4 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 1d83f3563fe..5579f27fb2e 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -22,7 +22,7 @@
"description": "Vulkan overlay: use the corresponding image index for each swapchain",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/vulkan/overlay-layer/overlay.cpp b/src/vulkan/overlay-layer/overlay.cpp
index dbffcbad6fe..7518bb850ac 100644
--- a/src/vulkan/overlay-layer/overlay.cpp
+++ b/src/vulkan/overlay-layer/overlay.cpp
@@ -1668,15 +1668,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);
@@ -1688,11 +1691,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,