aboutsummaryrefslogtreecommitdiff
path: root/layers/descriptor_sets.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-12-21 09:21:06 -0700
committerTobin Ehlis <tobine@google.com>2016-12-23 10:00:06 -0700
commit1ea01b198d9703e4e2788eac2187cfc7294f720c (patch)
tree02710a4d8ba61caa0d98c9c8fc950ad75243b427 /layers/descriptor_sets.cpp
parent8b0769250eef2c643a3d14419a1252c6470ad8c1 (diff)
downloadusermoji-1ea01b198d9703e4e2788eac2187cfc7294f720c.tar.xz
layers:Split ValidateAndUpdateDrawState()
Split ValidateAndUpdateDrawState() to isolate validation and state updates into ValidateDrawState() & UpdateDrawState() functions. Refactored CmdDraw() to use Pre/Post patter with all state updates now occurring in the Post function. Made some initial updates to other Draw/Dispatch functions to call each new function in-line, but will refactor these functions to use Pre/Post in follow-on commits.
Diffstat (limited to 'layers/descriptor_sets.cpp')
-rw-r--r--layers/descriptor_sets.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index 6cc0ec9d..5caa8bc7 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -699,7 +699,8 @@ void cvdescriptorset::DescriptorSet::PerformCopyUpdate(const VkCopyDescriptorSet
// 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
-void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node, const std::unordered_set<uint32_t> &bindings) {
+void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node,
+ const std::unordered_set<uint32_t> *active_bindings) {
// bind cb to this descriptor set
cb_bindings.insert(cb_node);
// Add bindings for descriptor set, the set's pool, and individual objects in the set
@@ -709,7 +710,7 @@ void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node,
{reinterpret_cast<uint64_t &>(pool_state_->pool), VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT});
// For the active slots, use set# to look up descriptorSet from boundDescriptorSets, and bind all of that descriptor set's
// resources
- for (auto binding : bindings) {
+ for (auto binding : *active_bindings) {
auto start_idx = p_layout_->GetGlobalStartIndexFromBinding(binding);
auto end_idx = p_layout_->GetGlobalEndIndexFromBinding(binding);
for (uint32_t i = start_idx; i <= end_idx; ++i) {