diff options
| -rw-r--r-- | layers/core_validation.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/layers/core_validation.h b/layers/core_validation.h index 8fbf5303..e87c3bab 100644 --- a/layers/core_validation.h +++ b/layers/core_validation.h @@ -690,7 +690,7 @@ typedef struct _DESCRIPTOR_POOL_NODE { _DESCRIPTOR_POOL_NODE(const VkDescriptorPool pool, const VkDescriptorPoolCreateInfo *pCreateInfo) : pool(pool), maxSets(pCreateInfo->maxSets), availableSets(pCreateInfo->maxSets), createInfo(*pCreateInfo), pSets(NULL), - maxDescriptorTypeCount(VK_DESCRIPTOR_TYPE_RANGE_SIZE), availableDescriptorTypeCount(VK_DESCRIPTOR_TYPE_RANGE_SIZE) { + maxDescriptorTypeCount(VK_DESCRIPTOR_TYPE_RANGE_SIZE, 0), availableDescriptorTypeCount(VK_DESCRIPTOR_TYPE_RANGE_SIZE, 0) { if (createInfo.poolSizeCount) { // Shadow type struct from ptr into local struct size_t poolSizeCountSize = createInfo.poolSizeCount * sizeof(VkDescriptorPoolSize); createInfo.pPoolSizes = new VkDescriptorPoolSize[poolSizeCountSize]; @@ -699,7 +699,8 @@ typedef struct _DESCRIPTOR_POOL_NODE { uint32_t i = 0; for (i = 0; i < createInfo.poolSizeCount; ++i) { uint32_t typeIndex = static_cast<uint32_t>(createInfo.pPoolSizes[i].type); - maxDescriptorTypeCount[typeIndex] = createInfo.pPoolSizes[i].descriptorCount; + // Same descriptor types can appear several times + maxDescriptorTypeCount[typeIndex] += createInfo.pPoolSizes[i].descriptorCount; availableDescriptorTypeCount[typeIndex] = maxDescriptorTypeCount[typeIndex]; } } else { |
