layers:Make DSLayout const in shared_ptrs
Declare DescriptorSetLayout's const for shared_ptrs in Pipeline layout
and DSAllocate structs.
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index cf4b738..62bdb77 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -149,7 +149,7 @@
unordered_map<VkCommandPool, COMMAND_POOL_NODE> commandPoolMap;
unordered_map<VkDescriptorPool, DESCRIPTOR_POOL_STATE *> descriptorPoolMap;
unordered_map<VkDescriptorSet, cvdescriptorset::DescriptorSet *> setMap;
- unordered_map<VkDescriptorSetLayout, std::shared_ptr<cvdescriptorset::DescriptorSetLayout>> descriptorSetLayoutMap;
+ unordered_map<VkDescriptorSetLayout, std::shared_ptr<cvdescriptorset::DescriptorSetLayout const>> descriptorSetLayoutMap;
unordered_map<VkPipelineLayout, PIPELINE_LAYOUT_NODE> pipelineLayoutMap;
unordered_map<VkDeviceMemory, unique_ptr<DEVICE_MEM_INFO>> memObjMap;
unordered_map<VkFence, FENCE_NODE> fenceMap;
@@ -709,8 +709,8 @@
return it->second.get();
}
-std::shared_ptr<cvdescriptorset::DescriptorSetLayout> const GetDescriptorSetLayout(layer_data const *dev_data,
- VkDescriptorSetLayout dsLayout) {
+std::shared_ptr<cvdescriptorset::DescriptorSetLayout const> const GetDescriptorSetLayout(layer_data const *dev_data,
+ VkDescriptorSetLayout dsLayout) {
auto it = dev_data->descriptorSetLayoutMap.find(dsLayout);
if (it == dev_data->descriptorSetLayoutMap.end()) {
return nullptr;
diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h
index 785c159..1d2761a 100644
--- a/layers/core_validation_types.h
+++ b/layers/core_validation_types.h
@@ -526,7 +526,7 @@
// Store layouts and pushconstants for PipelineLayout
struct PIPELINE_LAYOUT_NODE {
VkPipelineLayout layout;
- std::vector<std::shared_ptr<cvdescriptorset::DescriptorSetLayout>> set_layouts;
+ std::vector<std::shared_ptr<cvdescriptorset::DescriptorSetLayout const>> set_layouts;
std::vector<VkPushConstantRange> push_constant_ranges;
PIPELINE_LAYOUT_NODE() : layout(VK_NULL_HANDLE), set_layouts{}, push_constant_ranges{} {}
@@ -765,7 +765,7 @@
namespace core_validation {
struct layer_data;
cvdescriptorset::DescriptorSet *GetSetNode(const layer_data *, VkDescriptorSet);
-std::shared_ptr<cvdescriptorset::DescriptorSetLayout> const GetDescriptorSetLayout(layer_data const *, VkDescriptorSetLayout);
+std::shared_ptr<cvdescriptorset::DescriptorSetLayout const> const GetDescriptorSetLayout(layer_data const *, VkDescriptorSetLayout);
DESCRIPTOR_POOL_STATE *GetDescriptorPoolState(const layer_data *, const VkDescriptorPool);
BUFFER_STATE *GetBufferState(const layer_data *, VkBuffer);
IMAGE_STATE *GetImageState(const layer_data *, VkImage);
diff --git a/layers/descriptor_sets.h b/layers/descriptor_sets.h
index 239a477..56719d5 100644
--- a/layers/descriptor_sets.h
+++ b/layers/descriptor_sets.h
@@ -276,7 +276,7 @@
// Structs to contain common elements that need to be shared between Validate* and Perform* calls below
struct AllocateDescriptorSetsData {
uint32_t required_descriptors_by_type[VK_DESCRIPTOR_TYPE_RANGE_SIZE];
- std::vector<std::shared_ptr<DescriptorSetLayout>> layout_nodes;
+ std::vector<std::shared_ptr<DescriptorSetLayout const>> layout_nodes;
AllocateDescriptorSetsData(uint32_t);
};
// Helper functions for descriptor set functions that cross multiple sets