nvk: Use the page-aligned BO size for the descriptor pool

The BO may have more space in it than requested since it's aligned to
64K. We may as well make that available to the client.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28482>
This commit is contained in:
Faith Ekstrand
2024-03-29 16:58:06 -05:00
committed by Marge Bot
parent a2d3cdd5f2
commit 6cbd3a18d4

View File

@@ -476,6 +476,12 @@ nvk_CreateDescriptorPool(VkDevice _device,
nvk_destroy_descriptor_pool(dev, pAllocator, pool);
return vk_error(dev, VK_ERROR_OUT_OF_DEVICE_MEMORY);
}
/* The BO may be larger thanks to GPU page alignment. We may as well
* make that extra space available to the client.
*/
assert(pool->bo->size >= bo_size);
bo_size = pool->bo->size;
}
pool->size = bo_size;