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.
}
}
- 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);