diff options
| author | 2018-03-26 20:04:35 -0400 | |
|---|---|---|
| committer | 2018-03-26 21:16:49 -0400 | |
| commit | 1a9df83535589ced8c3bc66ffa620b3cb6d86074 (patch) | |
| tree | d23b412f058d4115f427e1ef802f26a865236102 /src | |
| parent | Merge pull request #283 from Subv/tsc (diff) | |
| download | yuzu-1a9df83535589ced8c3bc66ffa620b3cb6d86074.tar.gz yuzu-1a9df83535589ced8c3bc66ffa620b3cb6d86074.tar.xz yuzu-1a9df83535589ced8c3bc66ffa620b3cb6d86074.zip | |
renderer_opengl: Only draw the screen if a framebuffer is specified.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 1a24855d7..85e91c0e2 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -100,6 +100,8 @@ RendererOpenGL::~RendererOpenGL() = default; | |||
| 100 | 100 | ||
| 101 | /// Swap buffers (render frame) | 101 | /// Swap buffers (render frame) |
| 102 | void RendererOpenGL::SwapBuffers(boost::optional<const Tegra::FramebufferConfig&> framebuffer) { | 102 | void RendererOpenGL::SwapBuffers(boost::optional<const Tegra::FramebufferConfig&> framebuffer) { |
| 103 | Core::System::GetInstance().perf_stats.EndSystemFrame(); | ||
| 104 | |||
| 103 | // Maintain the rasterizer's state as a priority | 105 | // Maintain the rasterizer's state as a priority |
| 104 | OpenGLState prev_state = OpenGLState::GetCurState(); | 106 | OpenGLState prev_state = OpenGLState::GetCurState(); |
| 105 | state.Apply(); | 107 | state.Apply(); |
| @@ -114,20 +116,19 @@ void RendererOpenGL::SwapBuffers(boost::optional<const Tegra::FramebufferConfig& | |||
| 114 | // performance problem. | 116 | // performance problem. |
| 115 | ConfigureFramebufferTexture(screen_info.texture, *framebuffer); | 117 | ConfigureFramebufferTexture(screen_info.texture, *framebuffer); |
| 116 | } | 118 | } |
| 119 | |||
| 120 | // Load the framebuffer from memory, draw it to the screen, and swap buffers | ||
| 117 | LoadFBToScreenInfo(*framebuffer, screen_info); | 121 | LoadFBToScreenInfo(*framebuffer, screen_info); |
| 122 | DrawScreens(); | ||
| 123 | render_window->SwapBuffers(); | ||
| 118 | } | 124 | } |
| 119 | 125 | ||
| 120 | DrawScreens(); | ||
| 121 | |||
| 122 | Core::System::GetInstance().perf_stats.EndSystemFrame(); | ||
| 123 | |||
| 124 | // Swap buffers | ||
| 125 | render_window->PollEvents(); | 126 | render_window->PollEvents(); |
| 126 | render_window->SwapBuffers(); | ||
| 127 | 127 | ||
| 128 | Core::System::GetInstance().frame_limiter.DoFrameLimiting(CoreTiming::GetGlobalTimeUs()); | 128 | Core::System::GetInstance().frame_limiter.DoFrameLimiting(CoreTiming::GetGlobalTimeUs()); |
| 129 | Core::System::GetInstance().perf_stats.BeginSystemFrame(); | 129 | Core::System::GetInstance().perf_stats.BeginSystemFrame(); |
| 130 | 130 | ||
| 131 | // Restore the rasterizer state | ||
| 131 | prev_state.Apply(); | 132 | prev_state.Apply(); |
| 132 | RefreshRasterizerSetting(); | 133 | RefreshRasterizerSetting(); |
| 133 | } | 134 | } |