diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-26 05:19:15 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 20:59:17 +0100 |
commit | 0914c70b7f9d68e71779fa32c474ed896b225704 (patch) | |
tree | 41726a0380b9f65ce626722172e69938ad095bbe /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | gl_state: Remove clamp framebuffer color tracking (diff) | |
download | yuzu-0914c70b7f9d68e71779fa32c474ed896b225704.tar yuzu-0914c70b7f9d68e71779fa32c474ed896b225704.tar.gz yuzu-0914c70b7f9d68e71779fa32c474ed896b225704.tar.bz2 yuzu-0914c70b7f9d68e71779fa32c474ed896b225704.tar.lz yuzu-0914c70b7f9d68e71779fa32c474ed896b225704.tar.xz yuzu-0914c70b7f9d68e71779fa32c474ed896b225704.tar.zst yuzu-0914c70b7f9d68e71779fa32c474ed896b225704.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index d7971f86f..d0c811929 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -411,12 +411,10 @@ void RasterizerOpenGL::Clear() { use_color = true; } if (use_color) { - clear_state.color_mask[0].red_enabled = regs.clear_buffers.R ? GL_TRUE : GL_FALSE; - clear_state.color_mask[0].green_enabled = regs.clear_buffers.G ? GL_TRUE : GL_FALSE; - clear_state.color_mask[0].blue_enabled = regs.clear_buffers.B ? GL_TRUE : GL_FALSE; - clear_state.color_mask[0].alpha_enabled = regs.clear_buffers.A ? GL_TRUE : GL_FALSE; - // TODO: Signal state tracker about these changes + glColorMaski(0, regs.clear_buffers.R, regs.clear_buffers.G, regs.clear_buffers.B, + regs.clear_buffers.A); + SyncFramebufferSRGB(); // TODO(Rodrigo): Determine if clamping is used on clears SyncFragmentColorClampState(); @@ -1071,15 +1069,14 @@ void RasterizerOpenGL::SyncColorMask() { auto& maxwell3d = system.GPU().Maxwell3D(); const auto& regs = maxwell3d.regs; - const std::size_t count = - regs.independent_blend_enable ? Tegra::Engines::Maxwell3D::Regs::NumRenderTargets : 1; - for (std::size_t i = 0; i < count; i++) { - const auto& source = regs.color_mask[regs.color_mask_common ? 0 : i]; - auto& dest = state.color_mask[i]; - dest.red_enabled = (source.R == 0) ? GL_FALSE : GL_TRUE; - dest.green_enabled = (source.G == 0) ? GL_FALSE : GL_TRUE; - dest.blue_enabled = (source.B == 0) ? GL_FALSE : GL_TRUE; - dest.alpha_enabled = (source.A == 0) ? GL_FALSE : GL_TRUE; + if (regs.color_mask_common) { + auto& mask = regs.color_mask[0]; + glColorMask(mask.R, mask.B, mask.G, mask.A); + } else { + for (std::size_t i = 0; i < Maxwell::NumRenderTargets; ++i) { + const auto& mask = regs.color_mask[regs.color_mask_common ? 0 : i]; + glColorMaski(static_cast<GLuint>(i), mask.R, mask.G, mask.B, mask.A); + } } } |