From c5bc8e1a5a98212f80673b95b1389c4a95442a17 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 21 Jul 2016 14:40:22 -0600 Subject: layers: Add descriptor sets to CB_INVALID tracking This is start of a series intended to enable CB_INVALID tracking for descriptor sets. Much of the tracking is already in place in the special-purpose uniqueBoundSets data struct, so I'll be migrating the tracking from that struct to the more general-purpose object_bindings set. --- layers/descriptor_sets.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'layers/descriptor_sets.cpp') diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 1d568f4d..d9eb2777 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -320,12 +320,6 @@ cvdescriptorset::DescriptorSet::DescriptorSet(const VkDescriptorSet set, const D cvdescriptorset::DescriptorSet::~DescriptorSet() { InvalidateBoundCmdBuffers(); - // Remove link to any cmd buffers - for (auto cb : cb_bindings) { - for (uint32_t i=0; ilastBound[i].uniqueBoundSets.erase(this); - } - } } @@ -630,6 +624,16 @@ void cvdescriptorset::DescriptorSet::PerformCopyUpdate(const VkCopyDescriptorSet InvalidateBoundCmdBuffers(); } +void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node) { + // bind cb to this descriptor set + cb_bindings.insert(cb_node); + // Add bindings for descriptor set and individual objects in the set + cb_node->object_bindings.insert({reinterpret_cast(set_), VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT}); + // TODO : Can bind individual objects from within each descriptor : buffers/images and their views, samplers & memory + // The trick is we should only bind the objects actually "in use" by the cmd buffer, meaning that we need to + // check active descriptor slots based on last bound state for this CB +} + cvdescriptorset::SamplerDescriptor::SamplerDescriptor() : sampler_(VK_NULL_HANDLE), immutable_(false) { updated = false; descriptor_class = PlainSampler; -- cgit v1.2.3