From b5437fc05c7d8fb3899b073b451c7c658c4dc441 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 17 Mar 2017 15:07:44 -0700 Subject: anv: Implement VK_KHR_get_surface_capabilities2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Iglesias Gonsálvez --- src/intel/vulkan/anv_device.c | 4 ++++ src/intel/vulkan/anv_entrypoints_gen.py | 1 + src/intel/vulkan/anv_wsi.c | 27 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) (limited to 'src/intel') diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 35e40301a31..50486b62e1d 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -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, diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py index a21228c1c64..2168b7f64f0 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_get_surface_capabilities2', 'VK_KHR_incremental_present', 'VK_KHR_maintenance1', 'VK_KHR_push_descriptor', diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index 2ab37c30b70..7575f58ff24 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -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, -- cgit v1.2.3