anv: Implement VK_KHR_get_memory_requirements2
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 28 Apr 2017 12:13:08 +0000 (05:13 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 15 Jul 2017 15:59:38 +0000 (08:59 -0700)
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_entrypoints_gen.py

index 7bcda33b1b59a7b266cb0f004c1620f7558bcbc0..c2b3eb4a4a1f43a4d483f89b8345c42f2475e732 100644 (file)
@@ -444,6 +444,10 @@ static const VkExtensionProperties device_extensions[] = {
       .extensionName = VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME,
       .specVersion = 1,
    },
+   {
+      .extensionName = VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME,
+      .specVersion = 1,
+   },
    {
       .extensionName = VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME,
       .specVersion = 1,
@@ -1734,6 +1738,23 @@ void anv_GetBufferMemoryRequirements(
    pMemoryRequirements->memoryTypeBits = memory_types;
 }
 
+void anv_GetBufferMemoryRequirements2KHR(
+    VkDevice                                    _device,
+    const VkBufferMemoryRequirementsInfo2KHR*   pInfo,
+    VkMemoryRequirements2KHR*                   pMemoryRequirements)
+{
+   anv_GetBufferMemoryRequirements(_device, pInfo->buffer,
+                                   &pMemoryRequirements->memoryRequirements);
+
+   vk_foreach_struct(ext, pMemoryRequirements->pNext) {
+      switch (ext->sType) {
+      default:
+         anv_debug_ignored_stype(ext->sType);
+         break;
+      }
+   }
+}
+
 void anv_GetImageMemoryRequirements(
     VkDevice                                    _device,
     VkImage                                     _image,
@@ -1759,6 +1780,23 @@ void anv_GetImageMemoryRequirements(
    pMemoryRequirements->memoryTypeBits = memory_types;
 }
 
+void anv_GetImageMemoryRequirements2KHR(
+    VkDevice                                    _device,
+    const VkImageMemoryRequirementsInfo2KHR*    pInfo,
+    VkMemoryRequirements2KHR*                   pMemoryRequirements)
+{
+   anv_GetImageMemoryRequirements(_device, pInfo->image,
+                                  &pMemoryRequirements->memoryRequirements);
+
+   vk_foreach_struct(ext, pMemoryRequirements->pNext) {
+      switch (ext->sType) {
+      default:
+         anv_debug_ignored_stype(ext->sType);
+         break;
+      }
+   }
+}
+
 void anv_GetImageSparseMemoryRequirements(
     VkDevice                                    device,
     VkImage                                     image,
@@ -1768,6 +1806,15 @@ void anv_GetImageSparseMemoryRequirements(
    *pSparseMemoryRequirementCount = 0;
 }
 
+void anv_GetImageSparseMemoryRequirements2KHR(
+    VkDevice                                    device,
+    const VkImageSparseMemoryRequirementsInfo2KHR* pInfo,
+    uint32_t*                                   pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2KHR*        pSparseMemoryRequirements)
+{
+   *pSparseMemoryRequirementCount = 0;
+}
+
 void anv_GetDeviceMemoryCommitment(
     VkDevice                                    device,
     VkDeviceMemory                              memory,
index c2d35b723303ccb048bbc0088b9e98ee21e93832..4cc1f6a8be07507ea869a237a23c3190cb54d382 100644 (file)
@@ -34,6 +34,7 @@ MAX_API_VERSION = 1.0
 
 SUPPORTED_EXTENSIONS = [
     'VK_KHR_descriptor_update_template',
+    'VK_KHR_get_memory_requirements2',
     'VK_KHR_get_physical_device_properties2',
     'VK_KHR_get_surface_capabilities2',
     'VK_KHR_incremental_present',