diff options
author | Thomas Herzog <therzog@mail.de> | 2018-08-15 17:12:21 +0200 |
---|---|---|
committer | Thomas Herzog <therzog@mail.de> | 2018-08-15 17:12:21 +0200 |
commit | 0ef85b55e004f1b4a68aa57f9ae3a4a88ad1ee4c (patch) | |
tree | 80583e9af3c8bd6a33634656db24e03821ee64b6 | |
parent | 2f20836e522e1e86e6afe966c074a9d2bfa7ea14 (diff) |
[gles2] fix black bar artifacts
-rw-r--r-- | drivers/gles2/rasterizer_canvas_gles2.cpp | 1 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 6 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index 3d388c031a..d6fbf04353 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -75,6 +75,7 @@ void RasterizerCanvasGLES2::canvas_begin() { } if (storage->frame.clear_request) { + glColorMask(true, true, true, true); glClearColor(storage->frame.clear_request_color.r, storage->frame.clear_request_color.g, storage->frame.clear_request_color.b, diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index a1a0b9e2c6..73d93f7b46 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -392,6 +392,12 @@ void RasterizerGLES2::end_frame(bool p_swap_buffers) { OS::get_singleton()->swap_buffers(); else glFinish(); + + if (p_swap_buffers) { + glColorMask(true, true, true, true); + glClearColor(0, 0, 0, 1); + glClear(GL_COLOR_BUFFER_BIT); + } } void RasterizerGLES2::finalize() { diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 1bd3c0a935..6ff6bd7ced 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -3641,6 +3641,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) { texture_set_flags(rt->texture, texture->flags); + glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // copy texscreen buffers |