diff options
author | Chia-I Wu <[email protected]> | 2019-07-06 12:12:51 -0700 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2019-07-09 10:12:40 +0000 |
commit | e9e63bfba8a8353e7b6ab54242bdd2895f65b469 (patch) | |
tree | 1b313226f15b8c81da00bda24fd428bde82cc0f2 /src | |
parent | 84f76533e4834da5bb2a44260ffdb35c3c79fb36 (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]>
(cherry picked from commit 5824130389f2333ec44b48814b3e5e84ac297006)
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/anv_formats.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index 486ce0fc741..341a0a14fd2 100644 --- a/src/intel/vulkan/anv_formats.c +++ b/src/intel/vulkan/anv_formats.c @@ -977,6 +977,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; |