diff options
Diffstat (limited to 'src/intel/vulkan/anv_wsi.c')
-rw-r--r-- | src/intel/vulkan/anv_wsi.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index 064581d..c504658 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -76,6 +76,9 @@ void anv_DestroySurfaceKHR( ANV_FROM_HANDLE(anv_instance, instance, _instance); ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); + if (!surface) + return; + vk_free2(&instance->alloc, pAllocator, surface); } @@ -294,6 +297,9 @@ void anv_DestroySwapchainKHR( ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain); const VkAllocationCallbacks *alloc; + if (!swapchain) + return; + if (pAllocator) alloc = pAllocator; else @@ -323,13 +329,20 @@ VkResult anv_AcquireNextImageKHR( VkSwapchainKHR _swapchain, uint64_t timeout, VkSemaphore semaphore, - VkFence fence, + VkFence _fence, uint32_t* pImageIndex) { ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain); + ANV_FROM_HANDLE(anv_fence, fence, _fence); + + VkResult result = swapchain->acquire_next_image(swapchain, timeout, + semaphore, pImageIndex); - return swapchain->acquire_next_image(swapchain, timeout, semaphore, - pImageIndex); + /* Thanks to implicit sync, the image is ready immediately. */ + if (fence) + fence->state = ANV_FENCE_STATE_SIGNALED; + + return result; } VkResult anv_QueuePresentKHR( |