mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
venus: requests whole blob mem size for non-dedicated import
For non-dedicated import, later import could have varied size against the same bo, so we just request the whole blob mem size for those. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36128>
This commit is contained in:
parent
b32a8d17a2
commit
442f242a49
1 changed files with 7 additions and 2 deletions
|
|
@ -115,11 +115,16 @@ vn_device_memory_import_dma_buf(struct vn_device *dev,
|
|||
const VkMemoryType *mem_type =
|
||||
&dev->physical_device->memory_properties
|
||||
.memoryTypes[alloc_info->memoryTypeIndex];
|
||||
const VkMemoryDedicatedAllocateInfo *dedicated_info =
|
||||
vk_find_struct_const(alloc_info->pNext, MEMORY_DEDICATED_ALLOCATE_INFO);
|
||||
const bool is_dedicated =
|
||||
dedicated_info && (dedicated_info->image != VK_NULL_HANDLE ||
|
||||
dedicated_info->buffer != VK_NULL_HANDLE);
|
||||
|
||||
struct vn_renderer_bo *bo;
|
||||
VkResult result = vn_renderer_bo_create_from_dma_buf(
|
||||
dev->renderer, alloc_info->allocationSize, fd, mem_type->propertyFlags,
|
||||
&bo);
|
||||
dev->renderer, is_dedicated ? alloc_info->allocationSize : 0, fd,
|
||||
mem_type->propertyFlags, &bo);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue