Mesa (master): anv: Implement VK_KHR_incremental_present

Jason Ekstrand jekstrand at kemper.freedesktop.org
Mon Apr 3 20:51:16 UTC 2017


Module: Mesa
Branch: master
Commit: 0817110969e35eb265dc41fc5fd5d2fe2236db17
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0817110969e35eb265dc41fc5fd5d2fe2236db17

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Jan 24 15:13:31 2017 -0800

anv: Implement VK_KHR_incremental_present

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Daniel Stone <daniels at collabora.com>

---

 src/intel/vulkan/anv_device.c           |  6 +++++-
 src/intel/vulkan/anv_entrypoints_gen.py |  1 +
 src/intel/vulkan/anv_wsi.c              | 10 +++++++++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 4e4fa195a7..37b6f7273b 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -270,7 +270,11 @@ static const VkExtensionProperties device_extensions[] = {
    {
       .extensionName = VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME,
       .specVersion = 1,
-   }
+   },
+   {
+      .extensionName = VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME,
+      .specVersion = 1,
+   },
 };
 
 static void *
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py
index 203df4597d..1a7d75309c 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -35,6 +35,7 @@ MAX_API_VERSION = 1.0
 SUPPORTED_EXTENSIONS = [
     'VK_KHR_descriptor_update_template',
     'VK_KHR_get_physical_device_properties2',
+    'VK_KHR_incremental_present',
     'VK_KHR_maintenance1',
     'VK_KHR_push_descriptor',
     'VK_KHR_sampler_mirror_clamp_to_edge',
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 45bf896342..6a0203ac30 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 = &regions->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;




More information about the mesa-commit mailing list