From 4765e5fa64883c77aefd25ba0fd43b1250760fda Mon Sep 17 00:00:00 2001 From: clayjohn Date: Fri, 7 Oct 2022 14:13:40 -0700 Subject: [PATCH] Allow clearing backbuffer after finishing CanvasGroup This avoids an issue where having multiple CanvasGroups overlap would create a weird artifact --- drivers/gles3/rasterizer_canvas_gles3.cpp | 2 ++ servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index ab232e712cd..c635e181324 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -300,6 +300,8 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_ } canvas_group_owner = nullptr; + // Backbuffer is dirty now and needs to be re-cleared if another CanvasGroup needs it. + backbuffer_cleared = false; } if (backbuffer_copy) { diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp index 4c14ef7b9e4..e5e82552f41 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp @@ -1475,6 +1475,8 @@ void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p } canvas_group_owner = nullptr; + // Backbuffer is dirty now and needs to be re-cleared if another CanvasGroup needs it. + backbuffer_cleared = false; } if (backbuffer_copy) {