aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-08-22 10:10:43 -0600
committerTobin Ehlis <tobine@google.com>2016-08-24 06:59:39 -0600
commitbe111b45e6801baaedf86fa90570f362f1cf89d0 (patch)
tree1cec66bb1c44446f8a5934ffae16b7da608d2694 /layers/core_validation.cpp
parent7f1a5b24f68483d11153694ccf739cbb7b507f3c (diff)
downloadusermoji-be111b45e6801baaedf86fa90570f362f1cf89d0.tar.xz
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.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp8
1 files changed, 5 insertions, 3 deletions
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::tuple<cvdescriptorset::DescriptorSet *, unordered_map<uint32_t, descriptor_req>,
- std::vector<uint32_t> const *>> &activeSetBindingsPairs, const char *function) {
+ const vector<std::tuple<cvdescriptorset::DescriptorSet *, std::map<uint32_t, descriptor_req>, std::vector<uint32_t> 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::tuple<cvdescriptorset::DescriptorSet *, unordered_map<uint32_t, descriptor_req>, std::vector<uint32_t> const *>> activeSetBindingsPairs;
+ vector<std::tuple<cvdescriptorset::DescriptorSet *, std::map<uint32_t, descriptor_req>, std::vector<uint32_t> const *>>
+ activeSetBindingsPairs;
for (auto & setBindingPair : pPipe->active_slots) {
uint32_t setIndex = setBindingPair.first;
// If valid set is not bound throw an error