Merge pull request #21045 from karroffel/black-bar-fixes

[gles2] fix black bar artifacts
This commit is contained in:
Rémi Verschelde 2018-08-15 22:13:52 +02:00 committed by GitHub
commit d9067460d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -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,

View file

@ -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() {

View file

@ -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