From: Jason Ekstrand Date: Wed, 24 Feb 2016 05:23:06 +0000 (-0800) Subject: anv/descriptor_set: Use the correct size for the descriptor pool X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f0f7cc22f3f061416c81cf80ccbe4a6a390082a7;p=mesa.git 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. --- 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);