mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-21 03:48:22 +02:00
v3dv: allow TFU readahead padding above maxMemoryAllocationSize
Our get_buffer/image_memory_requirements() pad TRANSFER_SRC resources with V3D_TFU_READAHEAD_SIZE, so allocating the reported requirements of a resource of exactly maxMemoryAllocationSize failed with VK_ERROR_OUT_OF_DEVICE_MEMORY. Accept up to one extra page over the limit: since the allocation size is page-aligned, that covers any sub-page padding. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42179>
This commit is contained in:
parent
0c3a45c202
commit
cdc6a0bfed
1 changed files with 7 additions and 1 deletions
|
|
@ -2410,7 +2410,13 @@ v3dv_AllocateMemory(VkDevice _device,
|
|||
assert(pAllocateInfo->sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO);
|
||||
|
||||
const VkDeviceSize alloc_size = align64(pAllocateInfo->allocationSize, 4096);
|
||||
if (unlikely(alloc_size > MAX_MEMORY_ALLOCATION_SIZE))
|
||||
/* Our memory requirements pad TRANSFER_SRC resources with
|
||||
* V3D_TFU_READAHEAD_SIZE (and UBO/SSBO with 4 bytes for ldunifa), so
|
||||
* allocating the reported requirements of a resource of exactly
|
||||
* maxMemoryAllocationSize must succeed. Accept one extra page over
|
||||
* the limit, which covers any sub-page padding after alignment.
|
||||
*/
|
||||
if (unlikely(alloc_size > MAX_MEMORY_ALLOCATION_SIZE + 4096u))
|
||||
return vk_error(device, VK_ERROR_OUT_OF_DEVICE_MEMORY);
|
||||
|
||||
uint64_t heap_used = p_atomic_read(&pdevice->heap_used);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue