From c3b43b19f0c7efd9596a7fb223f3e4929740fc5d Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Tue, 15 Mar 2016 07:59:11 -0600 Subject: layers: GH130 Fix to correctly get type/flags from set binding We were using bindingToIndexMap to do look-ups into type and stage vectors which is incorrect. bindingToIndexMap is to index into the original pBindings map that was passed in when the layout was created. This fix does this to correctly pull type and stage of a binding in draw_state. --- layers/draw_state.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'layers/draw_state.cpp') diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 503d4207..f5435e4f 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -1341,11 +1341,13 @@ static bool has_descriptor_binding(layer_data *my_data, vectordescriptorSetLayoutMap[(*pipelineLayout)[slot.first]]; auto bindingIt = layout_node->bindingToIndexMap.find(slot.second); - if (bindingIt == layout_node->bindingToIndexMap.end()) + if ((bindingIt == layout_node->bindingToIndexMap.end()) || (layout_node->createInfo.pBindings == NULL)) return false; - type = layout_node->descriptorTypes[bindingIt->second]; - stage_flags = layout_node->stageFlags[bindingIt->second]; + assert(bindingIt->second < layout_node->createInfo.bindingCount); + VkDescriptorSetLayoutBinding binding = layout_node->createInfo.pBindings[bindingIt->second]; + type = binding.descriptorType; + stage_flags = binding.stageFlags; return true; } -- cgit v1.2.3