}
-void GLAPIENTRY
-_mesa_BlendEquationSeparate( GLenum modeRGB, GLenum modeA )
+static void
+blend_equation_separate(struct gl_context *ctx, GLenum modeRGB, GLenum modeA,
+ bool no_error)
{
- GET_CURRENT_CONTEXT(ctx);
const unsigned numBuffers = num_buffers(ctx);
unsigned buf;
bool changed = false;
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glBlendEquationSeparateEXT(%s %s)\n",
- _mesa_enum_to_string(modeRGB),
- _mesa_enum_to_string(modeA));
-
if (ctx->Color._BlendEquationPerBuffer) {
/* Check all per-buffer states */
for (buf = 0; buf < numBuffers; buf++) {
break;
}
}
- }
- else {
+ } else {
/* only need to check 0th per-buffer state */
if (ctx->Color.Blend[0].EquationRGB != modeRGB ||
ctx->Color.Blend[0].EquationA != modeA) {
if (!changed)
return;
- if ( (modeRGB != modeA) && !ctx->Extensions.EXT_blend_equation_separate ) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBlendEquationSeparateEXT not supported by driver");
- return;
- }
+ if (!no_error) {
+ if ((modeRGB != modeA) && !ctx->Extensions.EXT_blend_equation_separate) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlendEquationSeparateEXT not supported by driver");
+ return;
+ }
- /* Only allow simple blending equations.
- * The GL_KHR_blend_equation_advanced spec says:
- *
- * "NOTE: These enums are not accepted by the <modeRGB> or <modeAlpha>
- * parameters of BlendEquationSeparate or BlendEquationSeparatei."
- */
- if (!legal_simple_blend_equation(ctx, modeRGB)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeRGB)");
- return;
- }
+ /* Only allow simple blending equations.
+ * The GL_KHR_blend_equation_advanced spec says:
+ *
+ * "NOTE: These enums are not accepted by the <modeRGB> or <modeAlpha>
+ * parameters of BlendEquationSeparate or BlendEquationSeparatei."
+ */
+ if (!legal_simple_blend_equation(ctx, modeRGB)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glBlendEquationSeparateEXT(modeRGB)");
+ return;
+ }
- if (!legal_simple_blend_equation(ctx, modeA)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeA)");
- return;
+ if (!legal_simple_blend_equation(ctx, modeA)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeA)");
+ return;
+ }
}
_mesa_flush_vertices_for_blend_state(ctx);
}
+void GLAPIENTRY
+_mesa_BlendEquationSeparate(GLenum modeRGB, GLenum modeA)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glBlendEquationSeparateEXT(%s %s)\n",
+ _mesa_enum_to_string(modeRGB),
+ _mesa_enum_to_string(modeA));
+
+ blend_equation_separate(ctx, modeRGB, modeA, false);
+}
+
+
static void
blend_equation_separatei(struct gl_context *ctx, GLuint buf, GLenum modeRGB,
GLenum modeA)