diff options
| author | Tobin Ehlis <tobine@google.com> | 2017-06-21 10:08:52 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2017-06-21 10:51:36 -0600 |
| commit | a2e99be395d6d5158bad8b902c01bfcfaa9ad10d (patch) | |
| tree | c26783e3bafef8f02d09001cc4413a64912d1102 | |
| parent | c851790a64761cb422cdd6c0400da6f690c58ae1 (diff) | |
| download | usermoji-a2e99be395d6d5158bad8b902c01bfcfaa9ad10d.tar.xz | |
layers:IsCompatible uses raw DSLayout ptr
Update IsCompatible calls for DescriptorSetLayout class to use raw ptrs
instead of shared_ptr as the calls just temporarily use the ptr and
don't affect ptr ownership.
| -rw-r--r-- | layers/core_validation.cpp | 2 | ||||
| -rw-r--r-- | layers/descriptor_sets.cpp | 7 | ||||
| -rw-r--r-- | layers/descriptor_sets.h | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 187a7f53..cf4b738a 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -1061,7 +1061,7 @@ static bool verify_set_layout_compatibility(const cvdescriptorset::DescriptorSet return false; } auto layout_node = pipeline_layout->set_layouts[layoutIndex]; - return descriptor_set->IsCompatible(layout_node, &errorMsg); + return descriptor_set->IsCompatible(layout_node.get(), &errorMsg); } // Validate overall state at the time of a draw call diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 2a81a903..c6c7df04 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -209,7 +209,7 @@ VkSampler const *cvdescriptorset::DescriptorSetLayout::GetImmutableSamplerPtrFro } // If our layout is compatible with rh_ds_layout, return true, // else return false and fill in error_msg will description of what causes incompatibility -bool cvdescriptorset::DescriptorSetLayout::IsCompatible(std::shared_ptr<DescriptorSetLayout const> const rh_ds_layout, +bool cvdescriptorset::DescriptorSetLayout::IsCompatible(DescriptorSetLayout const *const rh_ds_layout, std::string *error_msg) const { // Trivial case if (layout_ == rh_ds_layout->GetDescriptorSetLayout()) return true; @@ -390,9 +390,8 @@ static std::string string_descriptor_req_view_type(descriptor_req req) { } // Is this sets underlying layout compatible with passed in layout according to "Pipeline Layout Compatibility" in spec? -bool cvdescriptorset::DescriptorSet::IsCompatible(std::shared_ptr<DescriptorSetLayout const> const layout, - std::string *error) const { - return layout->IsCompatible(p_layout_, error); +bool cvdescriptorset::DescriptorSet::IsCompatible(DescriptorSetLayout const *const layout, std::string *error) const { + return layout->IsCompatible(p_layout_.get(), error); } // Validate that the state of this set is appropriate for the given bindings and dynamic_offsets at Draw time diff --git a/layers/descriptor_sets.h b/layers/descriptor_sets.h index 0eeb6051..239a477c 100644 --- a/layers/descriptor_sets.h +++ b/layers/descriptor_sets.h @@ -110,7 +110,7 @@ class DescriptorSetLayout { bool HasBinding(const uint32_t binding) const { return binding_to_index_map_.count(binding) > 0; }; // Return true if this layout is compatible with passed in layout, // else return false and update error_msg with description of incompatibility - bool IsCompatible(std::shared_ptr<DescriptorSetLayout const> const, std::string *) const; + bool IsCompatible(DescriptorSetLayout const *const, std::string *) const; // Return true if binding 1 beyond given exists and has same type, stageFlags & immutable sampler use bool IsNextBindingConsistent(const uint32_t) const; // Various Get functions that can either be passed a binding#, which will @@ -342,7 +342,7 @@ class DescriptorSet : public BASE_NODE { // Return true if given binding is present in this set bool HasBinding(const uint32_t binding) const { return p_layout_->HasBinding(binding); }; // Is this set compatible with the given layout? - bool IsCompatible(std::shared_ptr<DescriptorSetLayout const> const, std::string *) const; + bool IsCompatible(DescriptorSetLayout const *const, 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::map<uint32_t, descriptor_req> &, const std::vector<uint32_t> &, const GLOBAL_CB_NODE *, const char *caller, std::string *) const; |
