From 37298876fc611f19bec47c92923ab76bab5b74cb Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 9 Mar 2019 13:15:14 +0100 Subject: [PATCH] Clear out FBO on startup. Some cores seem to rely on it? --- gfx/drivers/gl_core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gfx/drivers/gl_core.c b/gfx/drivers/gl_core.c index 1565833ee6..56af129ebb 100644 --- a/gfx/drivers/gl_core.c +++ b/gfx/drivers/gl_core.c @@ -427,6 +427,13 @@ static bool gl_core_init_hw_render(gl_core_t *gl, unsigned width, unsigned heigh return false; } + if (hwr->depth && hwr->stencil) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + else if (hwr->depth) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + else + glClear(GL_COLOR_BUFFER_BIT); + gl->hw_render_enable = true; gl->hw_render_max_width = width; gl->hw_render_max_height = height;