summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-01-15 00:20:19 -0500
committerGravatar bunnei2018-01-15 00:20:19 -0500
commit92801b1c345f2aa47d0b89c91313b44c08edbb86 (patch)
treee2c470cd5132b0b293bc118f21e24174c4397f2a /src
parentrenderer: Render previous frame when no new one is available. (diff)
downloadyuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.tar.gz
yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.tar.xz
yuzu-92801b1c345f2aa47d0b89c91313b44c08edbb86.zip
renderer_gl: Clear screen to black before rendering framebuffer.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp9
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h4
2 files changed, 8 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index f1c3ff948..50396b5c1 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -293,16 +293,16 @@ void RendererOpenGL::LoadFBToScreenInfo(const FramebufferInfo& framebuffer_info,
293 * Fills active OpenGL texture with the given RGB color. Since the color is solid, the texture can 293 * Fills active OpenGL texture with the given RGB color. Since the color is solid, the texture can
294 * be 1x1 but will stretch across whatever it's rendered on. 294 * be 1x1 but will stretch across whatever it's rendered on.
295 */ 295 */
296void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, 296void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a,
297 const TextureInfo& texture) { 297 const TextureInfo& texture) {
298 state.texture_units[0].texture_2d = texture.resource.handle; 298 state.texture_units[0].texture_2d = texture.resource.handle;
299 state.Apply(); 299 state.Apply();
300 300
301 glActiveTexture(GL_TEXTURE0); 301 glActiveTexture(GL_TEXTURE0);
302 u8 framebuffer_data[3] = {color_r, color_g, color_b}; 302 u8 framebuffer_data[4] = {color_a, color_b, color_g, color_r};
303 303
304 // Update existing texture 304 // Update existing texture
305 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, framebuffer_data); 305 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer_data);
306 306
307 state.texture_units[0].texture_2d = 0; 307 state.texture_units[0].texture_2d = 0;
308 state.Apply(); 308 state.Apply();
@@ -364,6 +364,9 @@ void RendererOpenGL::InitOpenGLObjects() {
364 364
365 state.texture_units[0].texture_2d = 0; 365 state.texture_units[0].texture_2d = 0;
366 state.Apply(); 366 state.Apply();
367
368 // Clear screen to black
369 LoadColorToActiveGLTexture(0, 0, 0, 0, screen_info.texture);
367} 370}
368 371
369void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture, 372void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture,
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h
index 2f5e35787..dd01e1b1a 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.h
+++ b/src/video_core/renderer_opengl/renderer_opengl.h
@@ -60,8 +60,8 @@ private:
60 60
61 // Loads framebuffer from emulated memory into the display information structure 61 // Loads framebuffer from emulated memory into the display information structure
62 void LoadFBToScreenInfo(const FramebufferInfo& framebuffer_info, ScreenInfo& screen_info); 62 void LoadFBToScreenInfo(const FramebufferInfo& framebuffer_info, ScreenInfo& screen_info);
63 // Fills active OpenGL texture with the given RGB color. 63 // Fills active OpenGL texture with the given RGBA color.
64 void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, const TextureInfo& texture); 64 void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a, const TextureInfo& texture);
65 65
66 EmuWindow* render_window; ///< Handle to render window 66 EmuWindow* render_window; ///< Handle to render window
67 67