リビジョン | 196a68dfbc3bbb26193f1a7b10c9dbd75338ffbb (tree) |
---|---|
日時 | 2020-02-11 02:01:38 |
作者 | Georg Lehmann <dadschoorse@gmai...> |
コミッター | Dylan Baker |
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)
@@ -22,7 +22,7 @@ | ||
22 | 22 | "description": "Vulkan overlay: use the corresponding image index for each swapchain", |
23 | 23 | "nominated": true, |
24 | 24 | "nomination_type": 0, |
25 | - "resolution": 0, | |
25 | + "resolution": 1, | |
26 | 26 | "master_sha": null, |
27 | 27 | "because_sha": null |
28 | 28 | }, |
@@ -1668,15 +1668,18 @@ static VkResult overlay_QueuePresentKHR( | ||
1668 | 1668 | struct swapchain_data *swapchain_data = |
1669 | 1669 | FIND(struct swapchain_data, swapchain); |
1670 | 1670 | |
1671 | + uint32_t image_index = pPresentInfo->pImageIndices[i]; | |
1672 | + | |
1671 | 1673 | before_present(swapchain_data, |
1672 | 1674 | queue_data, |
1673 | 1675 | pPresentInfo->pWaitSemaphores, |
1674 | 1676 | pPresentInfo->waitSemaphoreCount, |
1675 | - pPresentInfo->pImageIndices[i]); | |
1677 | + image_index); | |
1676 | 1678 | |
1677 | 1679 | VkPresentInfoKHR present_info = *pPresentInfo; |
1678 | 1680 | present_info.swapchainCount = 1; |
1679 | 1681 | present_info.pSwapchains = &swapchain; |
1682 | + present_info.pImageIndices = &image_index; | |
1680 | 1683 | |
1681 | 1684 | uint64_t ts0 = os_time_get(); |
1682 | 1685 | result = queue_data->device->vtable.QueuePresentKHR(queue, &present_info); |
@@ -1688,11 +1691,13 @@ static VkResult overlay_QueuePresentKHR( | ||
1688 | 1691 | VkSwapchainKHR swapchain = pPresentInfo->pSwapchains[i]; |
1689 | 1692 | struct swapchain_data *swapchain_data = |
1690 | 1693 | FIND(struct swapchain_data, swapchain); |
1694 | + | |
1695 | + uint32_t image_index = pPresentInfo->pImageIndices[i]; | |
1696 | + | |
1691 | 1697 | VkPresentInfoKHR present_info = *pPresentInfo; |
1692 | 1698 | present_info.swapchainCount = 1; |
1693 | 1699 | present_info.pSwapchains = &swapchain; |
1694 | - | |
1695 | - uint32_t image_index = pPresentInfo->pImageIndices[i]; | |
1700 | + present_info.pImageIndices = &image_index; | |
1696 | 1701 | |
1697 | 1702 | struct overlay_draw *draw = before_present(swapchain_data, |
1698 | 1703 | queue_data, |