aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
Diffstat (limited to 'layers')
-rw-r--r--layers/core_validation.cpp8
-rw-r--r--layers/core_validation_types.h3
-rw-r--r--layers/descriptor_sets.cpp4
-rw-r--r--layers/descriptor_sets.h5
4 files changed, 12 insertions, 8 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
diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h
index 0151bc70..926434d7 100644
--- a/layers/core_validation_types.h
+++ b/layers/core_validation_types.h
@@ -48,6 +48,7 @@
#include "vulkan/vulkan.h"
#include <atomic>
#include <functional>
+#include <map>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
@@ -488,7 +489,7 @@ class PIPELINE_NODE : public BASE_NODE {
uint32_t active_shaders;
uint32_t duplicate_shaders;
// Capture which slots (set#->bindings) are actually used by the shaders of this pipeline
- std::unordered_map<uint32_t, std::unordered_map<uint32_t, descriptor_req>> active_slots;
+ std::unordered_map<uint32_t, std::map<uint32_t, descriptor_req>> active_slots;
// Vtx input info (if any)
std::vector<VkVertexInputBindingDescription> vertexBindingDescriptions;
std::vector<VkVertexInputAttributeDescription> vertexAttributeDescriptions;
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index c47cb50f..c7b39f7c 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -343,7 +343,7 @@ bool cvdescriptorset::DescriptorSet::IsCompatible(const DescriptorSetLayout *lay
// This includes validating that all descriptors in the given bindings are updated,
// that any update buffers are valid, and that any dynamic offsets are within the bounds of their buffers.
// Return true if state is acceptable, or false and write an error message into error string
-bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::unordered_map<uint32_t, descriptor_req> &bindings,
+bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::map<uint32_t, descriptor_req> &bindings,
const std::vector<uint32_t> &dynamic_offsets, std::string *error) const {
auto dyn_offset_index = 0;
for (auto binding_pair : bindings) {
@@ -469,7 +469,7 @@ bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::unordered_map<
}
// For given bindings, place any update buffers or images into the passed-in unordered_sets
-uint32_t cvdescriptorset::DescriptorSet::GetStorageUpdates(const std::unordered_map<uint32_t, descriptor_req> &bindings,
+uint32_t cvdescriptorset::DescriptorSet::GetStorageUpdates(const std::map<uint32_t, descriptor_req> &bindings,
std::unordered_set<VkBuffer> *buffer_set,
std::unordered_set<VkImageView> *image_set) const {
auto num_updates = 0;
diff --git a/layers/descriptor_sets.h b/layers/descriptor_sets.h
index 92eb09a2..aeb071d9 100644
--- a/layers/descriptor_sets.h
+++ b/layers/descriptor_sets.h
@@ -47,6 +47,7 @@
#include "vk_layer_utils.h"
#include "vk_safe_struct.h"
#include "vulkan/vk_layer.h"
+#include <map>
#include <memory>
#include <unordered_map>
#include <unordered_set>
@@ -320,10 +321,10 @@ class DescriptorSet : public BASE_NODE {
// Is this set compatible with the given layout?
bool IsCompatible(const DescriptorSetLayout *, std::string *) const;
// For given bindings validate state at time of draw is correct, returning false on error and writing error details into string*
- bool ValidateDrawState(const std::unordered_map<uint32_t, descriptor_req> &, const std::vector<uint32_t> &, std::string *) const;
+ bool ValidateDrawState(const std::map<uint32_t, descriptor_req> &, const std::vector<uint32_t> &, std::string *) const;
// For given set of bindings, add any buffers and images that will be updated to their respective unordered_sets & return number
// of objects inserted
- uint32_t GetStorageUpdates(const std::unordered_map<uint32_t, descriptor_req> &, std::unordered_set<VkBuffer> *,
+ uint32_t GetStorageUpdates(const std::map<uint32_t, descriptor_req> &, std::unordered_set<VkBuffer> *,
std::unordered_set<VkImageView> *) const;
// Descriptor Update functions. These functions validate state and perform update separately