aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/blend.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/blend.c')
-rw-r--r--mesalib/src/mesa/main/blend.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/mesalib/src/mesa/main/blend.c b/mesalib/src/mesa/main/blend.c
index 5bc40a028..de871a92a 100644
--- a/mesalib/src/mesa/main/blend.c
+++ b/mesalib/src/mesa/main/blend.c
@@ -58,16 +58,18 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor)
case GL_DST_ALPHA:
case GL_ONE_MINUS_DST_ALPHA:
case GL_SRC_ALPHA_SATURATE:
+ return GL_TRUE;
case GL_CONSTANT_COLOR:
case GL_ONE_MINUS_CONSTANT_COLOR:
case GL_CONSTANT_ALPHA:
case GL_ONE_MINUS_CONSTANT_ALPHA:
- return GL_TRUE;
+ return _mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2;
case GL_SRC1_COLOR:
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
- return ctx->Extensions.ARB_blend_func_extended;
+ return _mesa_is_desktop_gl(ctx)
+ && ctx->Extensions.ARB_blend_func_extended;
default:
return GL_FALSE;
}
@@ -93,17 +95,22 @@ legal_dst_factor(const struct gl_context *ctx, GLenum factor)
case GL_ONE_MINUS_SRC_ALPHA:
case GL_DST_ALPHA:
case GL_ONE_MINUS_DST_ALPHA:
+ return GL_TRUE;
case GL_CONSTANT_COLOR:
case GL_ONE_MINUS_CONSTANT_COLOR:
case GL_CONSTANT_ALPHA:
case GL_ONE_MINUS_CONSTANT_ALPHA:
- return GL_TRUE;
+ return _mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2;
case GL_SRC_ALPHA_SATURATE:
+ return (_mesa_is_desktop_gl(ctx)
+ && ctx->Extensions.ARB_blend_func_extended)
+ || _mesa_is_gles3(ctx);
case GL_SRC1_COLOR:
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
- return ctx->Extensions.ARB_blend_func_extended;
+ return _mesa_is_desktop_gl(ctx)
+ && ctx->Extensions.ARB_blend_func_extended;
default:
return GL_FALSE;
}