anv/wsi: Use QueueSubmit to trigger the fence in AcquireNextImage
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
parent
f992bb205c
commit
738e5e3c1d
|
@ -364,22 +364,25 @@ VkResult anv_GetSwapchainImagesKHR(
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult anv_AcquireNextImageKHR(
|
VkResult anv_AcquireNextImageKHR(
|
||||||
VkDevice device,
|
VkDevice _device,
|
||||||
VkSwapchainKHR _swapchain,
|
VkSwapchainKHR _swapchain,
|
||||||
uint64_t timeout,
|
uint64_t timeout,
|
||||||
VkSemaphore semaphore,
|
VkSemaphore semaphore,
|
||||||
VkFence _fence,
|
VkFence _fence,
|
||||||
uint32_t* pImageIndex)
|
uint32_t* pImageIndex)
|
||||||
{
|
{
|
||||||
|
ANV_FROM_HANDLE(anv_device, device, _device);
|
||||||
ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
|
ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
|
||||||
ANV_FROM_HANDLE(anv_fence, fence, _fence);
|
ANV_FROM_HANDLE(anv_fence, fence, _fence);
|
||||||
|
|
||||||
VkResult result = swapchain->acquire_next_image(swapchain, timeout,
|
VkResult result = swapchain->acquire_next_image(swapchain, timeout,
|
||||||
semaphore, pImageIndex);
|
semaphore, pImageIndex);
|
||||||
|
|
||||||
/* Thanks to implicit sync, the image is ready immediately. */
|
/* Thanks to implicit sync, the image is ready immediately. However, we
|
||||||
|
* should wait for the current GPU state to finish.
|
||||||
|
*/
|
||||||
if (fence)
|
if (fence)
|
||||||
fence->state = ANV_FENCE_STATE_SIGNALED;
|
anv_QueueSubmit(anv_queue_to_handle(&device->queue), 0, NULL, _fence);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue