diff options
| author | John Zulauf <jzulauf@lunarg.com> | 2018-01-17 11:06:34 -0700 |
|---|---|---|
| committer | jzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com> | 2018-01-18 10:20:18 -0700 |
| commit | 4c0eb627a04186251aea4b63581ca74ccab0a956 (patch) | |
| tree | aa53db7dfdcbe01c4fd533581cb75ec86b8a0d50 /layers/core_validation.cpp | |
| parent | ee8a77ff00bf54fe11891602dfb334c8c2d93347 (diff) | |
| download | usermoji-4c0eb627a04186251aea4b63581ca74ccab0a956.tar.xz | |
layers: Add validation for destroyed layouts
Add three tests to flag with descriptor set update operations are being
done to descriptor sets with destroyed descriptor set layouts. The tests
use overload VUID (generic "must be valid * handles) which need to be
replaced with specific ones when they are added to the spec.
VALIDATION_ERROR_15c00280 (write dst must be valid) ->
write dst created from destroyed layout
VALIDATION_ERROR_03207601 (copy dst must be valid) ->
copy dst created from destroyed layout
VALIDATION_ERROR_0322d201 (copy src must be valid) ->
copy src create from destroyed layout
Change-Id: I8a3edc67b3e86037cdaa6353176814abfddef1a0
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index edd42a9f..a515e43c 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -138,7 +138,7 @@ struct layer_data { 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 const>> descriptorSetLayoutMap; + unordered_map<VkDescriptorSetLayout, std::shared_ptr<cvdescriptorset::DescriptorSetLayout>> descriptorSetLayoutMap; unordered_map<VkPipelineLayout, PIPELINE_LAYOUT_NODE> pipelineLayoutMap; unordered_map<VkDeviceMemory, unique_ptr<DEVICE_MEM_INFO>> memObjMap; unordered_map<VkFence, FENCE_NODE> fenceMap; @@ -3981,7 +3981,11 @@ VKAPI_ATTR void VKAPI_CALL DestroySampler(VkDevice device, VkSampler sampler, co } static void PostCallRecordDestroyDescriptorSetLayout(layer_data *dev_data, VkDescriptorSetLayout ds_layout) { - dev_data->descriptorSetLayoutMap.erase(ds_layout); + auto layout_it = dev_data->descriptorSetLayoutMap.find(ds_layout); + if (layout_it != dev_data->descriptorSetLayoutMap.end()) { + layout_it->second.get()->MarkDestroyed(); + dev_data->descriptorSetLayoutMap.erase(layout_it); + } } VKAPI_ATTR void VKAPI_CALL DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, |
