summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-12-26 07:51:50 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-28 21:34:43 +0100
commit1bc0da3dea5a8502e63f5c123151328ccb2ba8d6 (patch)
tree5a43fa241e32175df8be44fcb797609e5f75df0c /src/video_core/renderer_opengl/gl_rasterizer.cpp
parentgl_state: Remove stencil test tracking (diff)
downloadyuzu-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_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp49
1 files changed, 24 insertions, 25 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 573f14cab..f916f348f 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -442,7 +442,9 @@ void RasterizerOpenGL::Clear() {
}
// TODO: Signal state tracker about these changes
+ // TODO(Rodrigo): Find out if these changes affect clearing
glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
+ glDisablei(GL_BLEND, 0);
UNIMPLEMENTED_IF(regs.clear_flags.viewport);
@@ -1049,37 +1051,34 @@ void RasterizerOpenGL::SyncBlendState() {
glBlendColor(regs.blend_color.r, regs.blend_color.g, regs.blend_color.b, regs.blend_color.a);
- state.independant_blend.enabled = regs.independent_blend_enable;
- if (!state.independant_blend.enabled) {
- auto& blend = state.blend[0];
+ if (!regs.independent_blend_enable) {
const auto& src = regs.blend;
- blend.enabled = src.enable[0] != 0;
- if (blend.enabled) {
- blend.rgb_equation = MaxwellToGL::BlendEquation(src.equation_rgb);
- blend.src_rgb_func = MaxwellToGL::BlendFunc(src.factor_source_rgb);
- blend.dst_rgb_func = MaxwellToGL::BlendFunc(src.factor_dest_rgb);
- blend.a_equation = MaxwellToGL::BlendEquation(src.equation_a);
- blend.src_a_func = MaxwellToGL::BlendFunc(src.factor_source_a);
- blend.dst_a_func = MaxwellToGL::BlendFunc(src.factor_dest_a);
- }
- for (std::size_t i = 1; i < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; i++) {
- state.blend[i].enabled = false;
+ oglEnable(GL_BLEND, src.enable[0]);
+ if (!src.enable[0]) {
+ return;
}
+ glBlendFuncSeparate(MaxwellToGL::BlendFunc(src.factor_source_rgb),
+ MaxwellToGL::BlendFunc(src.factor_dest_rgb),
+ MaxwellToGL::BlendFunc(src.factor_source_a),
+ MaxwellToGL::BlendFunc(src.factor_dest_a));
+ glBlendEquationSeparate(MaxwellToGL::BlendEquation(src.equation_rgb),
+ MaxwellToGL::BlendEquation(src.equation_a));
return;
}
- for (std::size_t i = 0; i < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; i++) {
- auto& blend = state.blend[i];
- const auto& src = regs.independent_blend[i];
- blend.enabled = regs.blend.enable[i] != 0;
- if (!blend.enabled)
+ for (std::size_t i = 0; i < Maxwell::NumRenderTargets; ++i) {
+ oglEnablei(GL_BLEND, regs.blend.enable[i], static_cast<GLuint>(i));
+ if (!regs.blend.enable[i]) {
continue;
- blend.rgb_equation = MaxwellToGL::BlendEquation(src.equation_rgb);
- blend.src_rgb_func = MaxwellToGL::BlendFunc(src.factor_source_rgb);
- blend.dst_rgb_func = MaxwellToGL::BlendFunc(src.factor_dest_rgb);
- blend.a_equation = MaxwellToGL::BlendEquation(src.equation_a);
- blend.src_a_func = MaxwellToGL::BlendFunc(src.factor_source_a);
- blend.dst_a_func = MaxwellToGL::BlendFunc(src.factor_dest_a);
+ }
+ const auto& src = regs.independent_blend[i];
+ glBlendFuncSeparatei(static_cast<GLuint>(i), MaxwellToGL::BlendFunc(src.factor_source_rgb),
+ MaxwellToGL::BlendFunc(src.factor_dest_rgb),
+ MaxwellToGL::BlendFunc(src.factor_source_a),
+ MaxwellToGL::BlendFunc(src.factor_dest_a));
+ glBlendEquationSeparatei(static_cast<GLuint>(i),
+ MaxwellToGL::BlendEquation(src.equation_rgb),
+ MaxwellToGL::BlendEquation(src.equation_a));
}
}