From 379b5351a43c484a49b56a00f6edf7aa2b9ba9e3 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Wed, 21 Jun 2017 09:26:04 -0600 Subject: [PATCH] layers:Pass shared_ptr by const ref DescriptorSetLayout shared_ptr will always survive the lifetime of the DescriptorSet constructor so pass by const ref. --- layers/descriptor_sets.cpp | 2 +- layers/descriptor_sets.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index f4ce7a47..a0a300b2 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -313,7 +313,7 @@ cvdescriptorset::AllocateDescriptorSetsData::AllocateDescriptorSetsData(uint32_t : required_descriptors_by_type{}, layout_nodes(count, nullptr) {} cvdescriptorset::DescriptorSet::DescriptorSet(const VkDescriptorSet set, const VkDescriptorPool pool, - std::shared_ptr layout, const layer_data *dev_data) + const std::shared_ptr &layout, const layer_data *dev_data) : some_update_(false), set_(set), pool_state_(nullptr), diff --git a/layers/descriptor_sets.h b/layers/descriptor_sets.h index 975026d6..8b43b171 100644 --- a/layers/descriptor_sets.h +++ b/layers/descriptor_sets.h @@ -321,7 +321,7 @@ void PerformAllocateDescriptorSets(const VkDescriptorSetAllocateInfo *, const Vk */ class DescriptorSet : public BASE_NODE { public: - DescriptorSet(const VkDescriptorSet, const VkDescriptorPool, const std::shared_ptr, + DescriptorSet(const VkDescriptorSet, const VkDescriptorPool, const std::shared_ptr &, const core_validation::layer_data *); ~DescriptorSet(); // A number of common Get* functions that return data based on layout from which this set was created -- 2.34.1