summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2015-08-20 17:11:09 +0200
committerSubv <subv2112@gmail.com>2015-08-20 17:11:09 +0200
commit46f660a789ff02f9cd86600ed82e0936b049b176 (patch)
treeddb2c54c86025ac338549922c7c548844e38a68e /src/video_core/renderer_opengl/gl_state.cpp
parentGPU/Rasterizer: Corrected the stencil implementation. (diff)
downloadyuzu-46f660a789ff02f9cd86600ed82e0936b049b176.tar
yuzu-46f660a789ff02f9cd86600ed82e0936b049b176.tar.gz
yuzu-46f660a789ff02f9cd86600ed82e0936b049b176.tar.bz2
yuzu-46f660a789ff02f9cd86600ed82e0936b049b176.tar.lz
yuzu-46f660a789ff02f9cd86600ed82e0936b049b176.tar.xz
yuzu-46f660a789ff02f9cd86600ed82e0936b049b176.tar.zst
yuzu-46f660a789ff02f9cd86600ed82e0936b049b176.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp9
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);