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.
This commit is contained in:
Jason Ekstrand
2016-02-23 21:23:06 -08:00
parent 040355b688
commit f0f7cc22f3

View File

@@ -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);