anv: Implement VK_KHR_get_surface_capabilities2
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 17 Mar 2017 22:07:44 +0000 (15:07 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 16 May 2017 15:38:46 +0000 (08:38 -0700)
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_entrypoints_gen.py
src/intel/vulkan/anv_wsi.c

index 35e40301a313766cdee13d902091184aee1a4b52..50486b62e1daed3d1ae74b8987099b7852fe4f85 100644 (file)
@@ -305,6 +305,10 @@ static const VkExtensionProperties global_extensions[] = {
       .extensionName = VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
       .specVersion = 1,
    },
+   {
+      .extensionName = VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME,
+      .specVersion = 1,
+   },
    {
       .extensionName = VK_KHR_SURFACE_EXTENSION_NAME,
       .specVersion = 25,
index a21228c1c6436ecdc4d4a10fe03227d259d4d692..2168b7f64f0f3d62ad1db6298af253fc96d66338 100644 (file)
@@ -35,6 +35,7 @@ MAX_API_VERSION = 1.0
 SUPPORTED_EXTENSIONS = [
     'VK_KHR_descriptor_update_template',
     'VK_KHR_get_physical_device_properties2',
+    'VK_KHR_get_surface_capabilities2',
     'VK_KHR_incremental_present',
     'VK_KHR_maintenance1',
     'VK_KHR_push_descriptor',
index 2ab37c30b706beed6d81a36ca38b53154f379435..7575f58ff2411f30a310f3ad4b9d87f69aeb2b5c 100644 (file)
@@ -112,6 +112,19 @@ VkResult anv_GetPhysicalDeviceSurfaceCapabilitiesKHR(
    return iface->get_capabilities(surface, pSurfaceCapabilities);
 }
 
+VkResult anv_GetPhysicalDeviceSurfaceCapabilities2KHR(
+    VkPhysicalDevice                            physicalDevice,
+    const VkPhysicalDeviceSurfaceInfo2KHR*      pSurfaceInfo,
+    VkSurfaceCapabilities2KHR*                  pSurfaceCapabilities)
+{
+   ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice);
+   ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, pSurfaceInfo->surface);
+   struct wsi_interface *iface = device->wsi_device.wsi[surface->platform];
+
+   return iface->get_capabilities2(surface, pSurfaceInfo->pNext,
+                                   pSurfaceCapabilities);
+}
+
 VkResult anv_GetPhysicalDeviceSurfaceFormatsKHR(
     VkPhysicalDevice                            physicalDevice,
     VkSurfaceKHR                                _surface,
@@ -126,6 +139,20 @@ VkResult anv_GetPhysicalDeviceSurfaceFormatsKHR(
                              pSurfaceFormats);
 }
 
+VkResult anv_GetPhysicalDeviceSurfaceFormats2KHR(
+    VkPhysicalDevice                            physicalDevice,
+    const VkPhysicalDeviceSurfaceInfo2KHR*      pSurfaceInfo,
+    uint32_t*                                   pSurfaceFormatCount,
+    VkSurfaceFormat2KHR*                        pSurfaceFormats)
+{
+   ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice);
+   ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, pSurfaceInfo->surface);
+   struct wsi_interface *iface = device->wsi_device.wsi[surface->platform];
+
+   return iface->get_formats2(surface, &device->wsi_device, pSurfaceInfo->pNext,
+                              pSurfaceFormatCount, pSurfaceFormats);
+}
+
 VkResult anv_GetPhysicalDeviceSurfacePresentModesKHR(
     VkPhysicalDevice                            physicalDevice,
     VkSurfaceKHR                                _surface,