summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_android.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd/vulkan/radv_android.c')
-rw-r--r--src/amd/vulkan/radv_android.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_android.c b/src/amd/vulkan/radv_android.c
index f2fbeab459d..07123bf0af9 100644
--- a/src/amd/vulkan/radv_android.c
+++ b/src/amd/vulkan/radv_android.c
@@ -647,6 +647,23 @@ radv_import_ahb_memory(struct radv_device *device,
if (!mem->bo)
return VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (mem->image) {
+ struct radeon_bo_metadata metadata;
+ device->ws->buffer_get_metadata(mem->bo, &metadata);
+
+ struct radv_image_create_info create_info = {
+ .no_metadata_planes = true,
+ .bo_metadata = &metadata
+ };
+
+ VkResult result = radv_image_create_layout(device, create_info, mem->image);
+ if (result != VK_SUCCESS) {
+ device->ws->buffer_destroy(mem->bo);
+ mem->bo = NULL;
+ return result;
+ }
+ }
+
/* "If the vkAllocateMemory command succeeds, the implementation must
* acquire a reference to the imported hardware buffer, which it must
* release when the device memory object is freed. If the command fails,