diff options
author | Jason Ekstrand <[email protected]> | 2017-01-24 15:13:31 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-04-03 13:51:08 -0700 |
commit | 0817110969e35eb265dc41fc5fd5d2fe2236db17 (patch) | |
tree | 1d426fefc057bf60e99e17b3e34a853504acb335 /src/intel/vulkan/anv_wsi.c | |
parent | be1ecd8c6e3fbc20f62870c52b8e95ab2a5931ee (diff) |
anv: Implement VK_KHR_incremental_present
Reviewed-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_wsi.c')
-rw-r--r-- | src/intel/vulkan/anv_wsi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index 45bf8963427..6a0203ac30e 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -24,6 +24,7 @@ #include "anv_private.h" #include "wsi_common.h" #include "vk_format_info.h" +#include "util/vk_util.h" static const struct wsi_callbacks wsi_cbs = { .get_phys_device_format_properties = anv_GetPhysicalDeviceFormatProperties, @@ -355,10 +356,17 @@ VkResult anv_QueuePresentKHR( ANV_FROM_HANDLE(anv_queue, queue, _queue); VkResult result = VK_SUCCESS; + const VkPresentRegionsKHR *regions = + vk_find_struct_const(pPresentInfo->pNext, PRESENT_REGIONS_KHR); + for (uint32_t i = 0; i < pPresentInfo->swapchainCount; i++) { ANV_FROM_HANDLE(wsi_swapchain, swapchain, pPresentInfo->pSwapchains[i]); VkResult item_result; + const VkPresentRegionKHR *region = NULL; + if (regions && regions->pRegions) + region = ®ions->pRegions[i]; + assert(anv_device_from_handle(swapchain->device) == queue->device); if (swapchain->fences[0] == VK_NULL_HANDLE) { @@ -381,7 +389,7 @@ VkResult anv_QueuePresentKHR( item_result = swapchain->queue_present(swapchain, pPresentInfo->pImageIndices[i], - NULL); + region); /* TODO: What if one of them returns OUT_OF_DATE? */ if (pPresentInfo->pResults != NULL) pPresentInfo->pResults[i] = item_result; |