Fixes #2485
Verify that a descriptor's sampler is still valid at draw time. We had
a validation hole here where we missed this case if the sampler was
destroyed before the related descriptor was bound to a cmd buffer. This
plugs that hole by making sure all sampler descriptors used at draw
time still have a valid sampler.
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;
+ }
+ }
}
}
}