From 232cba4976761d364d2081e123749dbaf7e213ad Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Fri, 24 Jun 2016 17:22:16 -0600 Subject: 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. --- layers/descriptor_sets.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'layers/descriptor_sets.cpp') diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 1f72d447..3767f78d 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -321,7 +321,7 @@ cvdescriptorset::DescriptorSet::DescriptorSet(const VkDescriptorSet set, const D 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; ilastBound[i].uniqueBoundSets.erase(this); } @@ -460,9 +460,8 @@ uint32_t cvdescriptorset::DescriptorSet::GetStorageUpdates(const std::unordered_ } // 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(set_), VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT}); } // Perform write update in given update struct void cvdescriptorset::DescriptorSet::PerformWriteUpdate(const VkWriteDescriptorSet *update) { -- cgit v1.2.3