[Mesa-dev] [PATCH 10/17] mesa: add KHR_no_error support for glBlendFunc*iARB()

Timothy Arceri tarceri at itsqueeze.com
Mon May 15 06:19:19 UTC 2017


---
 src/mapi/glapi/gen/ARB_draw_buffers_blend.xml |  4 ++--
 src/mesa/main/blend.c                         | 18 ++++++++++++++++++
 src/mesa/main/blend.h                         |  6 ++++++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_draw_buffers_blend.xml b/src/mapi/glapi/gen/ARB_draw_buffers_blend.xml
index 8c33fbf..4d44adf 100644
--- a/src/mapi/glapi/gen/ARB_draw_buffers_blend.xml
+++ b/src/mapi/glapi/gen/ARB_draw_buffers_blend.xml
@@ -12,27 +12,27 @@
         <param name="buf" type="GLuint"/>
         <param name="mode" type="GLenum"/>
     </function>
 
     <function name="BlendEquationSeparateiARB">
         <param name="buf" type="GLuint"/>
         <param name="modeRGB" type="GLenum"/>
         <param name="modeA" type="GLenum"/>
     </function>
 
-    <function name="BlendFunciARB">
+    <function name="BlendFunciARB" no_error="true">
         <param name="buf" type="GLuint"/>
         <param name="src" type="GLenum"/>
         <param name="dst" type="GLenum"/>
     </function>
 
-    <function name="BlendFuncSeparateiARB">
+    <function name="BlendFuncSeparateiARB" no_error="true">
         <param name="buf" type="GLuint"/>
         <param name="srcRGB" type="GLenum"/>
         <param name="dstRGB" type="GLenum"/>
         <param name="srcA" type="GLenum"/>
         <param name="dstA" type="GLenum"/>
     </function>
 
 </category>
 
 </OpenGLAPI>
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index ed519bc..8811ef9 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -275,20 +275,28 @@ _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB,
 
    ctx->Color._BlendFuncPerBuffer = GL_FALSE;
 
    if (ctx->Driver.BlendFuncSeparate) {
       ctx->Driver.BlendFuncSeparate(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,
+                                        dfactor);
+}
+
+
 /**
  * Set blend source/dest factors for one color buffer/target.
  */
 void GLAPIENTRY
 _mesa_BlendFunciARB(GLuint buf, GLenum sfactor, GLenum dfactor)
 {
    _mesa_BlendFuncSeparateiARB(buf, sfactor, dfactor, sfactor, dfactor);
 }
 
 
@@ -327,20 +335,30 @@ blend_func_separatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
 
    ctx->Color.Blend[buf].SrcRGB = sfactorRGB;
    ctx->Color.Blend[buf].DstRGB = dfactorRGB;
    ctx->Color.Blend[buf].SrcA = sfactorA;
    ctx->Color.Blend[buf].DstA = dfactorA;
    update_uses_dual_src(ctx, buf);
    ctx->Color._BlendFuncPerBuffer = GL_TRUE;
 }
 
 
+void GLAPIENTRY
+_mesa_BlendFuncSeparateiARB_no_error(GLuint buf, GLenum sfactorRGB,
+                                     GLenum dfactorRGB, GLenum sfactorA,
+                                     GLenum dfactorA)
+{
+   blend_func_separatei(buf, sfactorRGB, dfactorRGB, sfactorA, dfactorA,
+                        true);
+}
+
+
 /**
  * Set separate blend source/dest factors for one color buffer/target.
  */
 void GLAPIENTRY
 _mesa_BlendFuncSeparateiARB(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
                             GLenum sfactorA, GLenum dfactorA)
 {
    blend_func_separatei(buf, sfactorRGB, dfactorRGB, sfactorA, dfactorA,
                         false);
 }
diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h
index 8ab9e02..199345d 100644
--- a/src/mesa/main/blend.h
+++ b/src/mesa/main/blend.h
@@ -43,24 +43,30 @@ struct gl_framebuffer;
 extern void GLAPIENTRY
 _mesa_BlendFunc( GLenum sfactor, GLenum dfactor );
 
 
 extern void GLAPIENTRY
 _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB,
                             GLenum sfactorA, GLenum dfactorA );
 
 
 extern void GLAPIENTRY
+_mesa_BlendFunciARB_no_error(GLuint buf, GLenum sfactor, GLenum dfactor);
+extern void GLAPIENTRY
 _mesa_BlendFunciARB(GLuint buf, GLenum sfactor, GLenum dfactor);
 
 
 extern void GLAPIENTRY
+_mesa_BlendFuncSeparateiARB_no_error(GLuint buf, GLenum sfactorRGB,
+                                     GLenum dfactorRGB, GLenum sfactorA,
+                                     GLenum dfactorA);
+extern void GLAPIENTRY
 _mesa_BlendFuncSeparateiARB(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
                          GLenum sfactorA, GLenum dfactorA);
 
 
 extern void GLAPIENTRY
 _mesa_BlendEquation( GLenum mode );
 
 
 extern void GLAPIENTRY
 _mesa_BlendEquationiARB(GLuint buf, GLenum mode);
-- 
2.9.3



More information about the mesa-dev mailing list