radv: implement VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2
authorDave Airlie <airlied@redhat.com>
Fri, 11 Nov 2016 02:27:21 +0000 (02:27 +0000)
committerDave Airlie <airlied@redhat.com>
Sat, 28 Jan 2017 00:52:23 +0000 (10:52 +1000)
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_formats.c

index a4b1295..5ee18e7 100644 (file)
@@ -119,6 +119,10 @@ static const VkExtensionProperties common_device_extensions[] = {
                .extensionName = VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME,
                .specVersion = 1,
        },
+       {
+               .extensionName = VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
+               .specVersion = 1,
+       },
 };
 
 static VkResult
@@ -467,6 +471,13 @@ void radv_GetPhysicalDeviceFeatures(
        };
 }
 
+void radv_GetPhysicalDeviceFeatures2KHR(
+       VkPhysicalDevice                            physicalDevice,
+       VkPhysicalDeviceFeatures2KHR               *pFeatures)
+{
+       return radv_GetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features);
+}
+
 void radv_GetPhysicalDeviceProperties(
        VkPhysicalDevice                            physicalDevice,
        VkPhysicalDeviceProperties*                 pProperties)
@@ -600,6 +611,13 @@ void radv_GetPhysicalDeviceProperties(
        memcpy(pProperties->pipelineCacheUUID, pdevice->uuid, VK_UUID_SIZE);
 }
 
+void radv_GetPhysicalDeviceProperties2KHR(
+       VkPhysicalDevice                            physicalDevice,
+       VkPhysicalDeviceProperties2KHR             *pProperties)
+{
+       return radv_GetPhysicalDeviceProperties(physicalDevice, &pProperties->properties);
+}
+
 void radv_GetPhysicalDeviceQueueFamilyProperties(
        VkPhysicalDevice                            physicalDevice,
        uint32_t*                                   pCount,
@@ -650,9 +668,19 @@ void radv_GetPhysicalDeviceQueueFamilyProperties(
        *pCount = idx;
 }
 
+void radv_GetPhysicalDeviceQueueFamilyProperties2KHR(
+       VkPhysicalDevice                            physicalDevice,
+       uint32_t*                                   pCount,
+       VkQueueFamilyProperties2KHR                *pQueueFamilyProperties)
+{
+       return radv_GetPhysicalDeviceQueueFamilyProperties(physicalDevice,
+                                                          pCount,
+                                                          &pQueueFamilyProperties->queueFamilyProperties);
+}
+
 void radv_GetPhysicalDeviceMemoryProperties(
        VkPhysicalDevice                            physicalDevice,
-       VkPhysicalDeviceMemoryProperties*           pMemoryProperties)
+       VkPhysicalDeviceMemoryProperties           *pMemoryProperties)
 {
        RADV_FROM_HANDLE(radv_physical_device, physical_device, physicalDevice);
 
@@ -699,6 +727,14 @@ void radv_GetPhysicalDeviceMemoryProperties(
        };
 }
 
+void radv_GetPhysicalDeviceMemoryProperties2KHR(
+       VkPhysicalDevice                            physicalDevice,
+       VkPhysicalDeviceMemoryProperties2KHR       *pMemoryProperties)
+{
+       return radv_GetPhysicalDeviceMemoryProperties(physicalDevice,
+                                                     &pMemoryProperties->memoryProperties);
+}
+
 static int
 radv_queue_init(struct radv_device *device, struct radv_queue *queue,
                int queue_family_index, int idx)
index e276432..87c28f1 100644 (file)
@@ -957,6 +957,18 @@ void radv_GetPhysicalDeviceFormatProperties(
                                                   pFormatProperties);
 }
 
+void radv_GetPhysicalDeviceFormatProperties2KHR(
+       VkPhysicalDevice                            physicalDevice,
+       VkFormat                                    format,
+       VkFormatProperties2KHR*                         pFormatProperties)
+{
+       RADV_FROM_HANDLE(radv_physical_device, physical_device, physicalDevice);
+
+       radv_physical_device_get_format_properties(physical_device,
+                                                  format,
+                                                  &pFormatProperties->formatProperties);
+}
+
 VkResult radv_GetPhysicalDeviceImageFormatProperties(
        VkPhysicalDevice                            physicalDevice,
        VkFormat                                    format,
@@ -1071,6 +1083,20 @@ unsupported:
        return VK_ERROR_FORMAT_NOT_SUPPORTED;
 }
 
+VkResult radv_GetPhysicalDeviceImageFormatProperties2KHR(
+       VkPhysicalDevice                            physicalDevice,
+       const VkPhysicalDeviceImageFormatInfo2KHR*  pImageFormatInfo,
+       VkImageFormatProperties2KHR                *pImageFormatProperties)
+{
+       return radv_GetPhysicalDeviceImageFormatProperties(physicalDevice,
+                                                          pImageFormatInfo->format,
+                                                          pImageFormatInfo->type,
+                                                          pImageFormatInfo->tiling,
+                                                          pImageFormatInfo->usage,
+                                                          pImageFormatInfo->flags,
+                                                          &pImageFormatProperties->imageFormatProperties);
+}
+
 void radv_GetPhysicalDeviceSparseImageFormatProperties(
        VkPhysicalDevice                            physicalDevice,
        VkFormat                                    format,
@@ -1084,3 +1110,13 @@ void radv_GetPhysicalDeviceSparseImageFormatProperties(
        /* Sparse images are not yet supported. */
        *pNumProperties = 0;
 }
+
+void radv_GetPhysicalDeviceSparseImageFormatProperties2KHR(
+       VkPhysicalDevice                            physicalDevice,
+       const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
+       uint32_t                                   *pPropertyCount,
+       VkSparseImageFormatProperties2KHR*          pProperties)
+{
+       /* Sparse images are not yet supported. */
+       *pPropertyCount = 0;
+}