summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-06-28 15:28:13 +1000
committerTimothy Arceri <[email protected]>2017-06-29 08:54:11 +1000
commitc1b1cad586115ee37bd808b4241ad881c6ade63e (patch)
tree2dfa07d740ee77f70aaa2543cdf1b7a7124d1a85
parentf21a764092b9f031c459f1b4f22b08a33da5111f (diff)
mesa: add KHR_no_error support for glBlendFunc*()
Reviewed-by: Samuel Pitoiset <[email protected]>
-rw-r--r--src/mapi/glapi/gen/gl_API.xml4
-rw-r--r--src/mesa/main/blend.c25
-rw-r--r--src/mesa/main/blend.h5
3 files changed, 32 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index f726fe3477d..18839ec70c3 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -2545,7 +2545,7 @@
<glx rop="159"/>
</function>
- <function name="BlendFunc" es1="1.0" es2="2.0">
+ <function name="BlendFunc" es1="1.0" es2="2.0" no_error="true">
<param name="sfactor" type="GLenum"/>
<param name="dfactor" type="GLenum"/>
<glx rop="160"/>
@@ -4709,7 +4709,7 @@
</enum>
<enum name="COMPARE_R_TO_TEXTURE" value="0x884E"/>
- <function name="BlendFuncSeparate" es2="2.0">
+ <function name="BlendFuncSeparate" es2="2.0" no_error="true">
<param name="sfactorRGB" type="GLenum"/>
<param name="dfactorRGB" type="GLenum"/>
<param name="sfactorAlpha" type="GLenum"/>
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index b06ec334062..32656283115 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -278,6 +278,18 @@ _mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
}
+void GLAPIENTRY
+_mesa_BlendFunc_no_error(GLenum sfactor, GLenum dfactor)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (skip_blend_state_update(ctx, sfactor, dfactor, sfactor, dfactor))
+ return;
+
+ blend_func_separate(ctx, sfactor, dfactor, sfactor, dfactor);
+}
+
+
/**
* Set the separate blend source/dest factors for all draw buffers.
*
@@ -315,6 +327,19 @@ _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB,
void GLAPIENTRY
+_mesa_BlendFuncSeparate_no_error(GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (skip_blend_state_update(ctx, sfactorRGB, dfactorRGB, sfactorA, dfactorA))
+ return;
+
+ blend_func_separate(ctx, sfactorRGB, dfactorRGB, sfactorA, dfactorA);
+}
+
+
+void GLAPIENTRY
_mesa_BlendFunciARB_no_error(GLuint buf, GLenum sfactor, GLenum dfactor)
{
_mesa_BlendFuncSeparateiARB_no_error(buf, sfactor, dfactor, sfactor,
diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h
index b0a8cbd200b..0f0bb624aee 100644
--- a/src/mesa/main/blend.h
+++ b/src/mesa/main/blend.h
@@ -45,11 +45,16 @@ struct gl_framebuffer;
extern void GLAPIENTRY
_mesa_BlendFunc( GLenum sfactor, GLenum dfactor );
+extern void GLAPIENTRY
+_mesa_BlendFunc_no_error(GLenum sfactor, GLenum dfactor);
extern void GLAPIENTRY
_mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA );
+extern void GLAPIENTRY
+_mesa_BlendFuncSeparate_no_error(GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA);
extern void GLAPIENTRY
_mesa_BlendFunciARB_no_error(GLuint buf, GLenum sfactor, GLenum dfactor);