diff options
| author | bunnei <bunneidev@gmail.com> | 2015-05-31 02:21:55 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2015-05-31 02:21:55 -0400 |
| commit | 8852fc6a87eaf8edbb26e93d44c1596f0167e3ac (patch) | |
| tree | 2ff0e6c796bcc3d489c7fb3e67a78bccbc4a3cc4 /src/video_core/renderer_opengl/gl_state.cpp | |
| parent | 595fe49a8f69de5e6c0b6aad3f5a2a2e2b88a23e (diff) | |
| parent | 33b9abb91e17e39ebadfa34ff3f6dac9f07f87d7 (diff) | |
Merge pull request #822 from bunnei/pica-improvements
Pica improvements
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 0d7ba1983..9c5f38f94 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) { |
