diff options
| author | Norbert Nopper <norbert@nopper.tv> | 2016-04-13 01:08:36 +0200 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-04-13 14:54:47 -0600 |
| commit | adcf4a1234b9f077ec8fdce4f56dc004b7fc3f30 (patch) | |
| tree | c163ca3fc043338aaa3613383dd4b992496ec2f7 | |
| parent | a7708c0a9cd69f21595b1776cc00da1cf4045b8e (diff) | |
| download | usermoji-adcf4a1234b9f077ec8fdce4f56dc004b7fc3f30.tar.xz | |
layers: Fix vkCreateDescriptorPool max allocation sizes for each type
VkDescriptorPoolSize array can contain more than one of same VkDescriptorType
| -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 { |
