diff options
| author | bunnei <bunneidev@gmail.com> | 2015-08-29 20:06:25 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2015-08-29 20:06:25 -0400 |
| commit | 58e9f78844168e2770bf0b43d6931569642f27fb (patch) | |
| tree | f0a3705f7e09bf6a067467553eac2119a691984b /src/video_core/renderer_opengl/gl_state.cpp | |
| parent | bac1a6b1405fef5d4432d2d5b9cee33fabb0b0d8 (diff) | |
| parent | 583d777b1a844259e6a389c420281388fce68dc4 (diff) | |
Merge pull request #1049 from Subv/stencil
Rasterizer: Corrected the stencil implementation.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 871324014..ba47ce8b8 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -26,6 +26,9 @@ OpenGLState::OpenGLState() { stencil.test_ref = 0; stencil.test_mask = -1; stencil.write_mask = -1; + stencil.action_depth_fail = GL_KEEP; + stencil.action_depth_pass = GL_KEEP; + stencil.action_stencil_fail = GL_KEEP; blend.enabled = false; blend.src_rgb_func = GL_ONE; @@ -105,6 +108,12 @@ void OpenGLState::Apply() { glStencilFunc(stencil.test_func, stencil.test_ref, stencil.test_mask); } + if (stencil.action_depth_fail != cur_state.stencil.action_depth_fail || + stencil.action_depth_pass != cur_state.stencil.action_depth_pass || + stencil.action_stencil_fail != cur_state.stencil.action_stencil_fail) { + glStencilOp(stencil.action_stencil_fail, stencil.action_depth_fail, stencil.action_depth_pass); + } + // Stencil mask if (stencil.write_mask != cur_state.stencil.write_mask) { glStencilMask(stencil.write_mask); |
