summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/blend.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-05-15 10:48:17 +1000
committerTimothy Arceri <[email protected]>2017-05-17 10:12:04 +1000
commit9aff3c605b925ad3302f392ad378198845438dfa (patch)
treee4babe692d209ed50c6aea779decc0df59389e3d /src/mesa/main/blend.c
parent5c8252ba6f7e43c563b7011facbbe4ef013e76c6 (diff)
mesa: add blend_equation_separatei() helper
Will be used to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/blend.c')
-rw-r--r--src/mesa/main/blend.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 8811ef9a339..e91c14aeb9d 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -599,6 +599,22 @@ _mesa_BlendEquationSeparate( GLenum modeRGB, GLenum modeA )
}
+static void
+blend_equation_separatei(struct gl_context *ctx, GLuint buf, GLenum modeRGB,
+ GLenum modeA)
+{
+ if (ctx->Color.Blend[buf].EquationRGB == modeRGB &&
+ ctx->Color.Blend[buf].EquationA == modeA)
+ return; /* no change */
+
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.Blend[buf].EquationRGB = modeRGB;
+ ctx->Color.Blend[buf].EquationA = modeA;
+ ctx->Color._BlendEquationPerBuffer = GL_TRUE;
+ ctx->Color._AdvancedBlendMode = BLEND_NONE;
+}
+
+
/**
* Set separate blend equations for one color buffer/target.
*/
@@ -634,15 +650,7 @@ _mesa_BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, GLenum modeA)
return;
}
- if (ctx->Color.Blend[buf].EquationRGB == modeRGB &&
- ctx->Color.Blend[buf].EquationA == modeA)
- return; /* no change */
-
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.Blend[buf].EquationRGB = modeRGB;
- ctx->Color.Blend[buf].EquationA = modeA;
- ctx->Color._BlendEquationPerBuffer = GL_TRUE;
- ctx->Color._AdvancedBlendMode = BLEND_NONE;
+ blend_equation_separatei(ctx, buf, modeRGB, modeA);
}