From be111b45e6801baaedf86fa90570f362f1cf89d0 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 22 Aug 2016 10:10:43 -0600 Subject: layers: Update descriptor binding to use an ordered map When dealing with dynamic offsets, the binding numbers, and array indices within a binding, are all sequential. This is according to the spec "Descriptor Set Binding" section which states, "...entries are ordered by the binding numbers in the descriptor set layouts; and within a binding array, elements are in order." This means when processing the binding numbers to validate the dynamic offsets at draw time, we should do so in order to make sure that the sequential dynamic offset index correctly correlates with the dynamic offset being processed. --- layers/core_validation.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index fafe5d72..6b7c8c9e 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2900,8 +2900,9 @@ cvdescriptorset::DescriptorSet *getSetNode(const layer_data *my_data, VkDescript // 3. Grow updateBuffers for pCB to include buffers from STORAGE*_BUFFER descriptor buffers static bool validate_and_update_drawtime_descriptor_state( layer_data *dev_data, GLOBAL_CB_NODE *pCB, - const vector, - std::vector const *>> &activeSetBindingsPairs, const char *function) { + const vector, std::vector const *>> + &activeSetBindingsPairs, + const char *function) { bool result = false; for (auto set_bindings_pair : activeSetBindingsPairs) { cvdescriptorset::DescriptorSet *set_node = std::get<0>(set_bindings_pair); @@ -3108,7 +3109,8 @@ static bool validate_and_update_draw_state(layer_data *my_data, GLOBAL_CB_NODE * auto pipeline_layout = pPipe->pipeline_layout; // Need a vector (vs. std::set) of active Sets for dynamicOffset validation in case same set bound w/ different offsets - vector, std::vector const *>> activeSetBindingsPairs; + vector, std::vector const *>> + activeSetBindingsPairs; for (auto & setBindingPair : pPipe->active_slots) { uint32_t setIndex = setBindingPair.first; // If valid set is not bound throw an error -- cgit v1.2.3