aboutsummaryrefslogtreecommitdiff
path: root/layers/descriptor_sets.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-08-17 09:49:13 -0600
committerTobin Ehlis <tobine@google.com>2016-08-23 18:41:47 -0600
commit30a92dd1dcd3c795110d79c9050194992158e46f (patch)
tree0356f0fd9c0ee94289cb65b270a4fe4ff6c216fc /layers/descriptor_sets.cpp
parentd792291b8651a1cc90a3f97bb5f01b31535e638e (diff)
downloadusermoji-30a92dd1dcd3c795110d79c9050194992158e46f.tar.xz
layers: Only bind active sets to cmd buffers
Don't create a binding between every set bound to a cmd buffer, but only the sets that are verified active at draw time. Gather up active descriptorset bindings in prepration of also binding the resources from each individual active set to the cmd buffer.
Diffstat (limited to 'layers/descriptor_sets.cpp')
-rw-r--r--layers/descriptor_sets.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index d9eb2777..38915b68 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -624,7 +624,11 @@ void cvdescriptorset::DescriptorSet::PerformCopyUpdate(const VkCopyDescriptorSet
InvalidateBoundCmdBuffers();
}
-void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node) {
+// Bind cb_node to this set and this set to cb_node.
+// Prereq: This should be called for a set that has been confirmed to be active for the given cb_node, meaning it's going
+// to be used in a draw by the given cb_node
+// TODO: For all of the active bindings, bind their underlying image/buffer/sampler resources to the cb_node
+void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node, const std::unordered_set<uint32_t> &bindings) {
// bind cb to this descriptor set
cb_bindings.insert(cb_node);
// Add bindings for descriptor set and individual objects in the set
@@ -632,6 +636,8 @@ void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node)
// 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
+ // For the active slots, use set# to look up descriptorSet from boundDescriptorSets, and bind all of that descriptor set's
+ // resources
}
cvdescriptorset::SamplerDescriptor::SamplerDescriptor() : sampler_(VK_NULL_HANDLE), immutable_(false) {