diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-04-15 11:59:39 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-04-18 08:51:16 -0600 |
| commit | 7b9c7df9429752dec171c56c272bef2d8e464715 (patch) | |
| tree | 011173f40b54c6f4b9f1b73e575a8c3584741115 /layers/core_validation.cpp | |
| parent | 3932eca981a798a02fbfb33645cc84070a86d7ea (diff) | |
| download | usermoji-7b9c7df9429752dec171c56c272bef2d8e464715.tar.xz | |
layers: Fix vkResetDescriptorPool
When we reset descriptor pool, need to remove the allocated
descriptors from setMap and free them.
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 15191b5a..c1ea5677 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -4194,12 +4194,17 @@ static void clearDescriptorPool(layer_data *my_data, const VkDevice device, cons "Unable to find pool node for pool %#" PRIxLEAST64 " specified in vkResetDescriptorPool() call", (uint64_t)pool); } else { // TODO: validate flags - // For every set off of this pool, clear it + // For every set off of this pool, clear it, remove from setMap, and free SET_NODE SET_NODE *pSet = pPool->pSets; + SET_NODE *pFreeSet = pSet; while (pSet) { clearDescriptorSet(my_data, pSet->set); + my_data->setMap.erase(pSet->set); + pFreeSet = pSet; pSet = pSet->pNext; + delete pFreeSet; } + pPool->pSets = nullptr; // Reset available count for each type and available sets for this pool for (uint32_t i = 0; i < pPool->availableDescriptorTypeCount.size(); ++i) { pPool->availableDescriptorTypeCount[i] = pPool->maxDescriptorTypeCount[i]; |
