layers: Unify invalid command buffer handling
Created a single vector to track any cmd buffer dependencies that are destroyed
and thereby cause the cmd buffer to become invalid. Currently just tracking
the previous object types of descriptor sets and framebuffers, but will update
the tracking to include all cmd buffer dependencies in future commits.
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index 1f72d44..3767f78 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -321,7 +321,7 @@
cvdescriptorset::DescriptorSet::~DescriptorSet() {
InvalidateBoundCmdBuffers();
// Remove link to any cmd buffers
- for (auto cb : bound_cmd_buffers_) {
+ for (auto cb : cb_bindings) {
for (uint32_t i=0; i<VK_PIPELINE_BIND_POINT_RANGE_SIZE; ++i) {
cb->lastBound[i].uniqueBoundSets.erase(this);
}
@@ -460,9 +460,8 @@
}
// Set is being deleted or updates so invalidate all bound cmd buffers
void cvdescriptorset::DescriptorSet::InvalidateBoundCmdBuffers() {
- for (auto cb_node : bound_cmd_buffers_) {
- cb_node->state = CB_INVALID;
- }
+ core_validation::invalidateCommandBuffers(cb_bindings,
+ {reinterpret_cast<uint64_t &>(set_), VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT});
}
// Perform write update in given update struct
void cvdescriptorset::DescriptorSet::PerformWriteUpdate(const VkWriteDescriptorSet *update) {