From f84c3d447797043c371e1b72e24b9049415e105e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 27 Sep 2023 16:04:05 +0200 Subject: [PATCH] Avoid trying to free null RIDs in FSR2 teardown --- servers/rendering/renderer_rd/effects/fsr2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/rendering/renderer_rd/effects/fsr2.cpp b/servers/rendering/renderer_rd/effects/fsr2.cpp index 1fea1f971627..0c389893049f 100644 --- a/servers/rendering/renderer_rd/effects/fsr2.cpp +++ b/servers/rendering/renderer_rd/effects/fsr2.cpp @@ -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); } }