From f0f7cc22f3f061416c81cf80ccbe4a6a390082a7 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 23 Feb 2016 21:23:06 -0800 Subject: [PATCH] anv/descriptor_set: Use the correct size for the descriptor pool The descriptor sizes array gives the total number of each type of descriptor that will ever be allocated from the pool, not the total amount that may be in any particular set. In our case, this simply means that we have to sum a bunch of things up and there we go. --- src/intel/vulkan/anv_descriptor_set.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index fe105b23f42..dd645c3effc 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -283,14 +283,11 @@ VkResult anv_CreateDescriptorPool( } } - const size_t set_size = - sizeof(struct anv_descriptor_set) + - descriptor_count * sizeof(struct anv_descriptor) + - buffer_count * sizeof(struct anv_buffer_view); - const size_t size = sizeof(*pool) + - pCreateInfo->maxSets * set_size; + pCreateInfo->maxSets * sizeof(struct anv_descriptor_set) + + descriptor_count * sizeof(struct anv_descriptor) + + buffer_count * sizeof(struct anv_buffer_view); pool = anv_alloc2(&device->alloc, pAllocator, size, 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); -- 2.30.2