summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2019-07-06 12:12:51 -0700
committerChia-I Wu <[email protected]>2019-07-07 13:31:58 -0700
commit5824130389f2333ec44b48814b3e5e84ac297006 (patch)
tree6b6868a0f19357a1d1da7df47b1faaf833e59497 /src
parentf3c7a02a62fdb8941c2201939efcd1caf13456cb (diff)
anv: fix VkExternalBufferProperties for host allocation
It was reported as unsupported previously. It should be importable and is compatible with itself. Signed-off-by: Chia-I Wu <[email protected]> Fixes: 69cc6272fbc199 ("anv: Implement VK_EXT_external_memory_host") Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_formats.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 8a5b6827666..9aa89d7b21d 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -974,6 +974,13 @@ static const VkExternalMemoryProperties prime_fd_props = {
VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
};
+static const VkExternalMemoryProperties userptr_props = {
+ .externalMemoryFeatures = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT,
+ .exportFromImportedHandleTypes = 0,
+ .compatibleHandleTypes =
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT,
+};
+
static const VkExternalMemoryProperties android_buffer_props = {
.externalMemoryFeatures = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT |
VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT,
@@ -1159,6 +1166,9 @@ void anv_GetPhysicalDeviceExternalBufferProperties(
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
pExternalBufferProperties->externalMemoryProperties = prime_fd_props;
return;
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT:
+ pExternalBufferProperties->externalMemoryProperties = userptr_props;
+ return;
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID:
if (physical_device->supported_extensions.ANDROID_external_memory_android_hardware_buffer) {
pExternalBufferProperties->externalMemoryProperties = android_buffer_props;