From 8c82aa5f43aa6aa288cb128f3866ca13bf1c505e Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 28 Apr 2017 05:13:08 -0700 Subject: anv: Implement VK_KHR_get_memory_requirements2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Iglesias Gonsálvez Reviewed-by: Lionel Landwerlin --- src/intel/vulkan/anv_device.c | 47 +++++++++++++++++++++++++++++++++ src/intel/vulkan/anv_entrypoints_gen.py | 1 + 2 files changed, 48 insertions(+) (limited to 'src/intel') diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 7bcda33b1b5..c2b3eb4a4a1 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -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, diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py index c2d35b72330..4cc1f6a8be0 100644 --- a/src/intel/vulkan/anv_entrypoints_gen.py +++ b/src/intel/vulkan/anv_entrypoints_gen.py @@ -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', -- cgit v1.2.3