diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-11-19 21:41:18 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-11-19 21:41:18 -0300 |
commit | d5ad1ca1aef52f08791fbc48e47897e8a5204539 (patch) | |
tree | 6a510084716e2c9294e9899542ae1166b46ed09c | |
parent | d30422800302d024499d5f895b2fbf598fe21a5a (diff) |
Fix crash on canvas with BG_MODE_KEEP, closes #19590
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 0951b8f798..b3c2332485 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -4297,8 +4297,10 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const glClearBufferfv(GL_COLOR, 0, clear_color.components); // specular } + VS::EnvironmentBG bg_mode = (!env || (probe && env->bg_mode == VS::ENV_BG_CANVAS)) ? VS::ENV_BG_CLEAR_COLOR : env->bg_mode; + if (env) { - switch (env->bg_mode) { + switch (bg_mode) { case VS::ENV_BG_COLOR_SKY: case VS::ENV_BG_SKY: |