diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-08-22 10:10:43 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-08-24 06:59:39 -0600 |
| commit | be111b45e6801baaedf86fa90570f362f1cf89d0 (patch) | |
| tree | 1cec66bb1c44446f8a5934ffae16b7da608d2694 /layers/descriptor_sets.h | |
| parent | 7f1a5b24f68483d11153694ccf739cbb7b507f3c (diff) | |
| download | usermoji-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/descriptor_sets.h')
| -rw-r--r-- | layers/descriptor_sets.h | 5 |
1 files changed, 3 insertions, 2 deletions
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 |
