diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-26 07:51:50 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 21:34:43 +0100 |
commit | 1bc0da3dea5a8502e63f5c123151328ccb2ba8d6 (patch) | |
tree | 5a43fa241e32175df8be44fcb797609e5f75df0c /src/video_core/renderer_opengl/gl_state.cpp | |
parent | gl_state: Remove stencil test tracking (diff) | |
download | yuzu-1bc0da3dea5a8502e63f5c123151328ccb2ba8d6.tar yuzu-1bc0da3dea5a8502e63f5c123151328ccb2ba8d6.tar.gz yuzu-1bc0da3dea5a8502e63f5c123151328ccb2ba8d6.tar.bz2 yuzu-1bc0da3dea5a8502e63f5c123151328ccb2ba8d6.tar.lz yuzu-1bc0da3dea5a8502e63f5c123151328ccb2ba8d6.tar.xz yuzu-1bc0da3dea5a8502e63f5c123151328ccb2ba8d6.tar.zst yuzu-1bc0da3dea5a8502e63f5c123151328ccb2ba8d6.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index d62a55b2f..3cdb9b4a0 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -106,66 +106,6 @@ void OpenGLState::ApplyProgramPipeline() { } } -void OpenGLState::ApplyGlobalBlending() { - const Blend& updated = blend[0]; - Blend& current = cur_state.blend[0]; - - Enable(GL_BLEND, current.enabled, updated.enabled); - - if (current.src_rgb_func != updated.src_rgb_func || - current.dst_rgb_func != updated.dst_rgb_func || current.src_a_func != updated.src_a_func || - current.dst_a_func != updated.dst_a_func) { - current.src_rgb_func = updated.src_rgb_func; - current.dst_rgb_func = updated.dst_rgb_func; - current.src_a_func = updated.src_a_func; - current.dst_a_func = updated.dst_a_func; - glBlendFuncSeparate(updated.src_rgb_func, updated.dst_rgb_func, updated.src_a_func, - updated.dst_a_func); - } - - if (current.rgb_equation != updated.rgb_equation || current.a_equation != updated.a_equation) { - current.rgb_equation = updated.rgb_equation; - current.a_equation = updated.a_equation; - glBlendEquationSeparate(updated.rgb_equation, updated.a_equation); - } -} - -void OpenGLState::ApplyTargetBlending(std::size_t target, bool force) { - const Blend& updated = blend[target]; - Blend& current = cur_state.blend[target]; - - if (current.enabled != updated.enabled || force) { - current.enabled = updated.enabled; - Enable(GL_BLEND, static_cast<GLuint>(target), updated.enabled); - } - - if (UpdateTie(std::tie(current.src_rgb_func, current.dst_rgb_func, current.src_a_func, - current.dst_a_func), - std::tie(updated.src_rgb_func, updated.dst_rgb_func, updated.src_a_func, - updated.dst_a_func))) { - glBlendFuncSeparatei(static_cast<GLuint>(target), updated.src_rgb_func, - updated.dst_rgb_func, updated.src_a_func, updated.dst_a_func); - } - - if (UpdateTie(std::tie(current.rgb_equation, current.a_equation), - std::tie(updated.rgb_equation, updated.a_equation))) { - glBlendEquationSeparatei(static_cast<GLuint>(target), updated.rgb_equation, - updated.a_equation); - } -} - -void OpenGLState::ApplyBlending() { - if (independant_blend.enabled) { - const bool force = independant_blend.enabled != cur_state.independant_blend.enabled; - for (std::size_t target = 0; target < Maxwell::NumRenderTargets; ++target) { - ApplyTargetBlending(target, force); - } - } else { - ApplyGlobalBlending(); - } - cur_state.independant_blend.enabled = independant_blend.enabled; -} - void OpenGLState::ApplyRenderBuffer() { if (cur_state.renderbuffer != renderbuffer) { cur_state.renderbuffer = renderbuffer; @@ -206,7 +146,6 @@ void OpenGLState::Apply() { ApplyFramebufferState(); ApplyShaderProgram(); ApplyProgramPipeline(); - ApplyBlending(); ApplyTextures(); ApplySamplers(); ApplyImages(); |