aboutsummaryrefslogtreecommitdiff
path: root/layers/descriptor_sets.h
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-06-24 17:22:16 -0600
committerTobin Ehlis <tobine@google.com>2016-06-28 07:40:04 -0600
commit232cba4976761d364d2081e123749dbaf7e213ad (patch)
treefa940bf0dacc764cf9ea3578ba8ad3b85f216f79 /layers/descriptor_sets.h
parent72a4047d2dbbcfef42251914e1b534d306365ebd (diff)
downloadusermoji-232cba4976761d364d2081e123749dbaf7e213ad.tar.xz
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.
Diffstat (limited to 'layers/descriptor_sets.h')
-rw-r--r--layers/descriptor_sets.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/layers/descriptor_sets.h b/layers/descriptor_sets.h
index 92824597..609f5d0a 100644
--- a/layers/descriptor_sets.h
+++ b/layers/descriptor_sets.h
@@ -286,6 +286,7 @@ void PerformAllocateDescriptorSets(const VkDescriptorSetAllocateInfo *, const Vk
class DescriptorSet : public BASE_NODE {
public:
using BASE_NODE::in_use;
+ using BASE_NODE::cb_bindings;
DescriptorSet(const VkDescriptorSet, const DescriptorSetLayout *, const core_validation::layer_data *);
~DescriptorSet();
// A number of common Get* functions that return data based on layout from which this set was created
@@ -331,11 +332,11 @@ class DescriptorSet : public BASE_NODE {
const DescriptorSetLayout *GetLayout() const { return p_layout_; };
VkDescriptorSet GetSet() const { return set_; };
// Return unordered_set of all command buffers that this set is bound to
- std::unordered_set<GLOBAL_CB_NODE *> GetBoundCmdBuffers() const { return bound_cmd_buffers_; }
+ std::unordered_set<GLOBAL_CB_NODE *> GetBoundCmdBuffers() const { return cb_bindings; }
// Bind given cmd_buffer to this descriptor set
- void BindCommandBuffer(GLOBAL_CB_NODE *cb_node) { bound_cmd_buffers_.insert(cb_node); }
- // If given cmd_buffer is in the bound_cmd_buffers_ set, remove it
- void RemoveBoundCommandBuffer(GLOBAL_CB_NODE *cb_node) { bound_cmd_buffers_.erase(cb_node); }
+ void BindCommandBuffer(GLOBAL_CB_NODE *cb_node) { cb_bindings.insert(cb_node); }
+ // If given cmd_buffer is in the cb_bindings set, remove it
+ void RemoveBoundCommandBuffer(GLOBAL_CB_NODE *cb_node) { cb_bindings.erase(cb_node); }
VkSampler const *GetImmutableSamplerPtrFromBinding(const uint32_t index) const {
return p_layout_->GetImmutableSamplerPtrFromBinding(index);
};
@@ -359,7 +360,6 @@ class DescriptorSet : public BASE_NODE {
bool some_update_; // has any part of the set ever been updated?
VkDescriptorSet set_;
const DescriptorSetLayout *p_layout_;
- std::unordered_set<GLOBAL_CB_NODE *> bound_cmd_buffers_;
std::vector<std::unique_ptr<Descriptor>> descriptors_;
// Ptr to device data used for various data look-ups
const core_validation::layer_data *device_data_;