aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-05-17 14:23:46 -0600
committerTobin Ehlis <tobine@google.com>2016-05-19 06:51:41 -0600
commit8bfe8f2c5538e99939a8c5bccf7c1c59d69635ad (patch)
tree59b849235426e151a6a3dfee0412776919b22d29 /layers/core_validation.cpp
parentd21e9eb3754861ae1fed39fe8a6d825e11e30b47 (diff)
downloadusermoji-8bfe8f2c5538e99939a8c5bccf7c1c59d69635ad.tar.xz
layers: Improve DescriptorSet cleanup
Create private helper function InvalidateBoundCmdBuffers() within the DescriptorSet class to unify invalidate cases due to set being updated or freed. Add a destructor for DescriptorSet to make sure that no bound cmd buffers hang on to deleted set references.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 780d27de..3e5360ba 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3387,15 +3387,6 @@ static bool validateIdleDescriptorSet(const layer_data *my_data, VkDescriptorSet
}
return skip_call;
}
-static void invalidateBoundCmdBuffers(layer_data *dev_data, cvdescriptorset::DescriptorSet *pSet) {
- // Flag any CBs this set is bound to as INVALID and remove set binding
- for (auto cb_node : pSet->GetBoundCmdBuffers()) {
- cb_node->state = CB_INVALID;
- for (uint32_t i = 0; i < VK_PIPELINE_BIND_POINT_RANGE_SIZE; ++i) {
- cb_node->lastBound[i].uniqueBoundSets.erase(pSet);
- }
- }
-}
// update DS mappings based on write and copy update arrays
static bool dsUpdate(layer_data *my_data, VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pWDS,
uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pCDS) {
@@ -3505,7 +3496,6 @@ static bool validate_descriptor_availability_in_pool(layer_data *dev_data, DESCR
// Free the descriptor set, remove it from setMap and invalidate any cmd buffers that it was bound to
static void freeDescriptorSet(layer_data *dev_data, cvdescriptorset::DescriptorSet *descriptor_set) {
- invalidateBoundCmdBuffers(dev_data, descriptor_set);
dev_data->setMap.erase(descriptor_set->GetSet());
delete descriptor_set;
}