diff options
Diffstat (limited to 'layers/descriptor_sets.cpp')
| -rw-r--r-- | layers/descriptor_sets.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 66a8a48e..26796a03 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -620,6 +620,22 @@ bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::map<uint32_t, return false; } } + if (descriptor_class == ImageSampler || descriptor_class == PlainSampler) { + // Verify Sampler still valid + VkSampler sampler; + if (descriptor_class == ImageSampler) { + sampler = static_cast<ImageSamplerDescriptor *>(descriptors_[i].get())->GetSampler(); + } else { + sampler = static_cast<SamplerDescriptor *>(descriptors_[i].get())->GetSampler(); + } + if (!ValidateSampler(sampler, device_data_)) { + std::stringstream error_str; + error_str << "Descriptor in binding #" << binding << " at global descriptor index " << i + << " is using sampler " << sampler << " that has been destroyed."; + *error = error_str.str(); + return false; + } + } } } } |
