layers: Fix comparing DescriptorSetLayoutDef
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index 9d12d19..13dd6fa 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -171,6 +171,7 @@
for (uint32_t j = 0; j < list.descriptorTypeCount; ++j) {
mutable_types_[i].push_back(list.pDescriptorTypes[j]);
}
+ std::sort(mutable_types_[i].begin(), mutable_types_[i].end());
}
}
@@ -316,6 +317,10 @@
return false;
}
+const std::vector<std::vector<VkDescriptorType>>& cvdescriptorset::DescriptorSetLayoutDef::GetMutableTypes() const {
+ return mutable_types_;
+}
+
const std::vector<VkDescriptorType> &cvdescriptorset::DescriptorSetLayoutDef::GetMutableTypes(uint32_t binding) const {
if (binding >= mutable_types_.size()) {
static const std::vector<VkDescriptorType> empty = {};
diff --git a/layers/descriptor_sets.h b/layers/descriptor_sets.h
index a4c0815..bf3cf97 100644
--- a/layers/descriptor_sets.h
+++ b/layers/descriptor_sets.h
@@ -178,6 +178,7 @@
VkSampler const *GetImmutableSamplerPtrFromBinding(const uint32_t) const;
VkSampler const *GetImmutableSamplerPtrFromIndex(const uint32_t) const;
bool IsTypeMutable(const VkDescriptorType type, uint32_t binding) const;
+ const std::vector<std::vector<VkDescriptorType>> &GetMutableTypes() const;
const std::vector<VkDescriptorType> &GetMutableTypes(uint32_t binding) const;
// For a particular binding, get the global index range
// This call should be guarded by a call to "HasBinding(binding)" to verify that the given binding exists
@@ -216,8 +217,9 @@
};
static inline bool operator==(const DescriptorSetLayoutDef &lhs, const DescriptorSetLayoutDef &rhs) {
- bool result = (lhs.GetCreateFlags() == rhs.GetCreateFlags()) && (lhs.GetBindings() == rhs.GetBindings()) &&
- (lhs.GetBindingFlags() == rhs.GetBindingFlags());
+ bool result =
+ (lhs.GetCreateFlags() == rhs.GetCreateFlags()) && (lhs.GetBindings() == rhs.GetBindings()) &&
+ (lhs.GetBindingFlags() == rhs.GetBindingFlags() && lhs.GetMutableTypes() == rhs.GetMutableTypes());
return result;
}