diff options
author | tfarley <tfarleygithub@gmail.com> | 2015-05-29 03:41:37 +0200 |
---|---|---|
committer | tfarley <tfarleygithub@gmail.com> | 2015-06-09 01:18:17 +0200 |
commit | d42275f11cc53000fead76b7c695fb370d19e56d (patch) | |
tree | 351cd273da23c232bde19e49ca2f389dc1cb4dd0 /src/video_core/renderer_opengl | |
parent | Merge pull request #848 from lioncash/ldm (diff) | |
download | yuzu-d42275f11cc53000fead76b7c695fb370d19e56d.tar yuzu-d42275f11cc53000fead76b7c695fb370d19e56d.tar.gz yuzu-d42275f11cc53000fead76b7c695fb370d19e56d.tar.bz2 yuzu-d42275f11cc53000fead76b7c695fb370d19e56d.tar.lz yuzu-d42275f11cc53000fead76b7c695fb370d19e56d.tar.xz yuzu-d42275f11cc53000fead76b7c695fb370d19e56d.tar.zst yuzu-d42275f11cc53000fead76b7c695fb370d19e56d.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 4 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 13 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 7 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index d31c46cca..2f55bfd76 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -652,6 +652,10 @@ void RasterizerOpenGL::SyncDepthTest() { const auto& regs = Pica::g_state.regs; state.depth.test_enabled = (regs.output_merger.depth_test_enable == 1); state.depth.test_func = PicaToGL::CompareFunc(regs.output_merger.depth_test_func); + state.color_mask.red_enabled = regs.output_merger.red_enable; + state.color_mask.green_enabled = regs.output_merger.green_enable; + state.color_mask.blue_enabled = regs.output_merger.blue_enable; + state.color_mask.alpha_enabled = regs.output_merger.alpha_enable; state.depth.write_mask = regs.output_merger.depth_write_enable ? GL_TRUE : GL_FALSE; } diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 9c5f38f94..2305fb2cb 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -16,6 +16,11 @@ OpenGLState::OpenGLState() { depth.test_func = GL_LESS; depth.write_mask = GL_TRUE; + color_mask.red_enabled = GL_TRUE; + color_mask.green_enabled = GL_TRUE; + color_mask.blue_enabled = GL_TRUE; + color_mask.alpha_enabled = GL_TRUE; + stencil.test_enabled = false; stencil.test_func = GL_ALWAYS; stencil.test_ref = 0; @@ -77,6 +82,14 @@ void OpenGLState::Apply() { glDepthMask(depth.write_mask); } + // Color mask + if (color_mask.red_enabled != cur_state.color_mask.red_enabled || + color_mask.green_enabled != cur_state.color_mask.green_enabled || + color_mask.blue_enabled != cur_state.color_mask.blue_enabled || + color_mask.alpha_enabled != cur_state.color_mask.alpha_enabled) { + glColorMask(color_mask.red_enabled, color_mask.green_enabled, color_mask.blue_enabled, color_mask.alpha_enabled); + } + // Stencil test if (stencil.test_enabled != cur_state.stencil.test_enabled) { if (stencil.test_enabled) { diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index 6b97721d6..26b916360 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h @@ -20,6 +20,13 @@ public: } depth; struct { + GLboolean red_enabled; + GLboolean green_enabled; + GLboolean blue_enabled; + GLboolean alpha_enabled; + } color_mask; // GL_COLOR_WRITEMASK + + struct { bool test_enabled; // GL_STENCIL_TEST GLenum test_func; // GL_STENCIL_FUNC GLint test_ref; // GL_STENCIL_REF |