From af809b491e8c6d727b973ee70e54b10bfcddbab1 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 17 Sep 2019 02:36:47 -0300 Subject: gl_rasterizer: Remove unused code paths from ConfigureFramebuffers --- .../renderer_opengl/gl_framebuffer_cache.cpp | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_framebuffer_cache.cpp') diff --git a/src/video_core/renderer_opengl/gl_framebuffer_cache.cpp b/src/video_core/renderer_opengl/gl_framebuffer_cache.cpp index 7c926bd48..a5d69d78d 100644 --- a/src/video_core/renderer_opengl/gl_framebuffer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_framebuffer_cache.cpp @@ -35,21 +35,16 @@ OGLFramebuffer FramebufferCacheOpenGL::CreateFramebuffer(const FramebufferCacheK local_state.draw.draw_framebuffer = framebuffer.handle; local_state.ApplyFramebufferState(); - if (key.is_single_buffer) { - if (key.color_attachments[0] != GL_NONE && key.colors[0]) { - key.colors[0]->Attach(key.color_attachments[0], GL_DRAW_FRAMEBUFFER); - glDrawBuffer(key.color_attachments[0]); - } else { - glDrawBuffer(GL_NONE); - } - } else { - for (std::size_t index = 0; index < Maxwell::NumRenderTargets; ++index) { - if (key.colors[index]) { - key.colors[index]->Attach(GL_COLOR_ATTACHMENT0 + static_cast(index), - GL_DRAW_FRAMEBUFFER); - } + for (std::size_t index = 0; index < Maxwell::NumRenderTargets; ++index) { + if (key.colors[index]) { + key.colors[index]->Attach(GL_COLOR_ATTACHMENT0 + static_cast(index), + GL_DRAW_FRAMEBUFFER); } + } + if (key.colors_count) { glDrawBuffers(key.colors_count, key.color_attachments.data()); + } else { + glDrawBuffer(GL_NONE); } if (key.zeta) { @@ -67,9 +62,9 @@ std::size_t FramebufferCacheKey::Hash() const { } bool FramebufferCacheKey::operator==(const FramebufferCacheKey& rhs) const { - return std::tie(is_single_buffer, stencil_enable, colors_count, color_attachments, colors, - zeta) == std::tie(rhs.is_single_buffer, rhs.stencil_enable, rhs.colors_count, - rhs.color_attachments, rhs.colors, rhs.zeta); + return std::tie(stencil_enable, colors_count, color_attachments, colors, zeta) == + std::tie(rhs.stencil_enable, rhs.colors_count, rhs.color_attachments, rhs.colors, + rhs.zeta); } } // namespace OpenGL -- cgit v1.2.3