Avoid trying to free null RIDs in FSR2 teardown

This commit is contained in:
Pedro J. Estébanez 2023-09-27 16:04:05 +02:00
parent ec62b8a3ee
commit f84c3d4477

View file

@ -804,7 +804,9 @@ FSR2Effect::~FSR2Effect() {
RD::get_singleton()->free(device.linear_clamp_sampler);
for (uint32_t i = 0; i < FFX_FSR2_PASS_COUNT; i++) {
RD::get_singleton()->free(device.passes[i].pipeline.pipeline_rid);
if (device.passes[i].pipeline.pipeline_rid.is_valid()) {
RD::get_singleton()->free(device.passes[i].pipeline.pipeline_rid);
}
device.passes[i].shader->version_free(device.passes[i].shader_version);
}
}