diff options
author | David <25727384+ogniK5377@users.noreply.github.com> | 2019-09-22 15:10:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-22 15:10:07 +0200 |
commit | 3bfba233622da947efacf10a1ce1271a859b9939 (patch) | |
tree | 0751a9a153e0acc11ffa9ca12d8c21af56416f63 /src/video_core/renderer_opengl/gl_framebuffer_cache.cpp | |
parent | Merge pull request #2893 from ogniK5377/revert-dlz (diff) | |
parent | gl_rasterizer: Remove unused code paths from ConfigureFramebuffers (diff) | |
download | yuzu-3bfba233622da947efacf10a1ce1271a859b9939.tar yuzu-3bfba233622da947efacf10a1ce1271a859b9939.tar.gz yuzu-3bfba233622da947efacf10a1ce1271a859b9939.tar.bz2 yuzu-3bfba233622da947efacf10a1ce1271a859b9939.tar.lz yuzu-3bfba233622da947efacf10a1ce1271a859b9939.tar.xz yuzu-3bfba233622da947efacf10a1ce1271a859b9939.tar.zst yuzu-3bfba233622da947efacf10a1ce1271a859b9939.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_framebuffer_cache.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_framebuffer_cache.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
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<GLenum>(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<GLenum>(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 |