venus: adopt common vk_image::anb_memory

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41145>
This commit is contained in:
Yiwei Zhang 2026-04-23 18:44:29 -07:00 committed by Marge Bot
parent d4ae409365
commit 4c4302d14b
3 changed files with 3 additions and 13 deletions

View file

@ -334,8 +334,7 @@ vn_android_image_from_anb_internal(struct vn_device *dev,
goto fail;
}
/* Android WSI image owns the memory */
img->wsi.anb_mem = vn_device_memory_from_handle(mem_handle);
img->base.vk.anb_memory = mem_handle;
*out_img = img;
return VK_SUCCESS;
@ -362,7 +361,7 @@ vn_android_image_from_anb(struct vn_device *dev,
const VkBindImageMemoryInfo bind_info = {
.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO,
.image = vn_image_to_handle(img),
.memory = vn_device_memory_to_handle(img->wsi.anb_mem),
.memory = img->base.vk.anb_memory,
};
result = vn_BindImageMemory2(vn_device_to_handle(dev), 1, &bind_info);
if (result != VK_SUCCESS) {
@ -390,7 +389,7 @@ vn_android_get_wsi_memory(struct vn_device *dev,
if (result != VK_SUCCESS)
return VK_NULL_HANDLE;
return vn_device_memory_to_handle(img->wsi.anb_mem);
return img->base.vk.anb_memory;
}
static VkResult

View file

@ -630,12 +630,6 @@ vn_DestroyImage(VkDevice device,
if (!img)
return;
if (img->wsi.anb_mem) {
VkDeviceMemory mem_handle =
vn_device_memory_to_handle(img->wsi.anb_mem);
vn_FreeMemory(device, mem_handle, pAllocator);
}
/* must not ask renderer to destroy uninitialized deferred image */
if (!img->deferred || img->deferred_initialized)
vn_async_vkDestroyImage(dev->primary_ring, device, image, NULL);

View file

@ -58,9 +58,6 @@ struct vn_image {
/* memory backing the prime blit dst buffer */
struct vn_device_memory *blit_mem;
/* For VK_ANDROID_native_buffer, the WSI image owns the memory. */
struct vn_device_memory *anb_mem;
} wsi;
};
VK_DEFINE_NONDISP_HANDLE_CASTS(vn_image,