Mesa (master): anv: Implement VK_KHR_get_memory_requirements2
Jason Ekstrand
jekstrand at kemper.freedesktop.org
Sat Jul 15 16:00:42 UTC 2017
Module: Mesa
Branch: master
Commit: 8c82aa5f43aa6aa288cb128f3866ca13bf1c505e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c82aa5f43aa6aa288cb128f3866ca13bf1c505e
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Fri Apr 28 05:13:08 2017 -0700
anv: Implement VK_KHR_get_memory_requirements2
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
src/intel/vulkan/anv_device.c | 47 +++++++++++++++++++++++++++++++++
src/intel/vulkan/anv_entrypoints_gen.py | 1 +
2 files changed, 48 insertions(+)
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 7bcda33b1b..c2b3eb4a4a 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -445,6 +445,10 @@ static const VkExtensionProperties device_extensions[] = {
.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 c2d35b7233..4cc1f6a8be 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',
More information about the mesa-commit
mailing list