diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-09-17 07:36:47 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-09-17 07:50:42 +0200 |
commit | af809b491e8c6d727b973ee70e54b10bfcddbab1 (patch) | |
tree | 24c9d9fa3ccbff7febb6d515bdac9276ac4665d6 /src/video_core/renderer_opengl/gl_framebuffer_cache.cpp | |
parent | Merge pull request #2851 from ReinUsesLisp/srgb (diff) | |
download | yuzu-af809b491e8c6d727b973ee70e54b10bfcddbab1.tar yuzu-af809b491e8c6d727b973ee70e54b10bfcddbab1.tar.gz yuzu-af809b491e8c6d727b973ee70e54b10bfcddbab1.tar.bz2 yuzu-af809b491e8c6d727b973ee70e54b10bfcddbab1.tar.lz yuzu-af809b491e8c6d727b973ee70e54b10bfcddbab1.tar.xz yuzu-af809b491e8c6d727b973ee70e54b10bfcddbab1.tar.zst yuzu-af809b491e8c6d727b973ee70e54b10bfcddbab1.zip |
Diffstat (limited to '')
-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 |