mesa: add KHR_no_error support for glBlendFunc*()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 28 Jun 2017 05:28:13 +0000 (15:28 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 28 Jun 2017 22:54:11 +0000 (08:54 +1000)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/blend.c
src/mesa/main/blend.h

index f726fe3477db9d98e50d166dbeaff0ed4f122f59..18839ec70c3f39bff407f724fba4cfb0c34d72c5 100644 (file)
         <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"/>
     </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"/>
index b06ec334062a70944810411b9201c1ba55e16c3b..32656283115628884902aae6b4d767164ca52e74 100644 (file)
@@ -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.
  *
@@ -314,6 +326,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)
 {
index b0a8cbd200b4ae1d24ba7b0eb7bb9b9613376dd2..0f0bb624aeeda636437c390e1c66b8c323551c13 100644 (file)
@@ -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);