summaryrefslogtreecommitdiff
path: root/servers/rendering
diff options
context:
space:
mode:
authorNick Swoboda <nickswoboda@gmail.com>2020-11-18 16:49:56 -0800
committerNick Swoboda <nickswoboda@gmail.com>2020-11-18 16:53:11 -0800
commitbce3e2c3f6061f10599f4dc0f8143315e15142b5 (patch)
tree5bf3d6cf4347ff148bbb43736e854a650d281780 /servers/rendering
parenta3a3b02bed3137e0ccac2cbb544a71502a659b80 (diff)
Check uniform set validity before freeing
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp
index e1be9b0ef4..da2b00b7a7 100644
--- a/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp
@@ -1471,7 +1471,9 @@ void RasterizerSceneRD::_setup_giprobes(RID p_render_buffers, const Transform &p
}
if (giprobes_changed) {
- RD::get_singleton()->free(rb->gi_uniform_set);
+ if (RD::get_singleton()->uniform_set_is_valid(rb->gi_uniform_set)) {
+ RD::get_singleton()->free(rb->gi_uniform_set);
+ }
rb->gi_uniform_set = RID();
if (rb->volumetric_fog) {
if (RD::get_singleton()->uniform_set_is_valid(rb->volumetric_fog->uniform_set)) {