diff options
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 0d7ba198..9c5f38f9 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -32,6 +32,8 @@ OpenGLState::OpenGLState() { blend.color.blue = 0.0f; blend.color.alpha = 0.0f; + logic_op = GL_COPY; + for (auto& texture_unit : texture_units) { texture_unit.enabled_2d = false; texture_unit.texture_2d = 0; @@ -99,8 +101,13 @@ void OpenGLState::Apply() { if (blend.enabled != cur_state.blend.enabled) { if (blend.enabled) { glEnable(GL_BLEND); + + cur_state.logic_op = GL_COPY; + glLogicOp(cur_state.logic_op); + glDisable(GL_COLOR_LOGIC_OP); } else { glDisable(GL_BLEND); + glEnable(GL_COLOR_LOGIC_OP); } } @@ -118,6 +125,10 @@ void OpenGLState::Apply() { glBlendFuncSeparate(blend.src_rgb_func, blend.dst_rgb_func, blend.src_a_func, blend.dst_a_func); } + if (logic_op != cur_state.logic_op) { + glLogicOp(logic_op); + } + // Textures for (unsigned texture_index = 0; texture_index < ARRAY_SIZE(texture_units); ++texture_index) { if (texture_units[texture_index].enabled_2d != cur_state.texture_units[texture_index].enabled_2d) { |