From 6cbd3a18d4d32618a7eea9353efec9d87db15624 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Fri, 29 Mar 2024 16:58:06 -0500 Subject: [PATCH] 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 Part-of: --- src/nouveau/vulkan/nvk_descriptor_set.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nouveau/vulkan/nvk_descriptor_set.c b/src/nouveau/vulkan/nvk_descriptor_set.c index e3d5822bee2..33e921bc637 100644 --- a/src/nouveau/vulkan/nvk_descriptor_set.c +++ b/src/nouveau/vulkan/nvk_descriptor_set.c @@ -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;