mesa: add KHR_no_error support for glBindFragDataLocation*()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 28 Jun 2017 04:46:06 +0000 (14:46 +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/ARB_blend_func_extended.xml
src/mapi/glapi/gen/GL3x.xml
src/mesa/main/shader_query.cpp
src/mesa/main/shaderapi.h

index 406140f7ddf46e76b7efa8748e6262f05e9094ae..10d85a766211895064e9cfa533df0c7f87276a46 100644 (file)
@@ -8,7 +8,7 @@
 
 <category name="GL_ARB_blend_func_extended" number="78">
 
-    <function name="BindFragDataLocationIndexed">
+    <function name="BindFragDataLocationIndexed" no_error="true">
         <param name="program" type="GLuint"/>
         <param name="colorNumber" type="GLuint"/>
         <param name="index" type="GLuint"/>
index f488ba36aecdd82cd0149559d2d186eaf70236ce..24490da7e32cf37e25a864976528aeea5eb47578 100644 (file)
       <return type="GLint"/>
   </function>
 
-  <function name="BindFragDataLocation">
+  <function name="BindFragDataLocation" no_error="true">
     <param name="program" type="GLuint"/>
     <param name="colorNumber" type="GLuint"/>
     <param name="name" type="const GLchar *"/>
index 6e373ef6411be1018b91a70d2d872756c59fa87a..f2bdcaab1212d48c6047c57c7a9629b97a238e24 100644 (file)
@@ -279,6 +279,21 @@ _mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
    _mesa_BindFragDataLocationIndexed(program, colorNumber, 0, name);
 }
 
+void GLAPIENTRY
+_mesa_BindFragDataLocation_no_error(GLuint program, GLuint colorNumber,
+                                    const GLchar *name)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (!name)
+      return;
+
+   struct gl_shader_program *const shProg =
+      _mesa_lookup_shader_program(ctx, program);
+
+   bind_frag_data_location(shProg, name, colorNumber, 0);
+}
+
 void GLAPIENTRY
 _mesa_BindFragDataLocationIndexed(GLuint program, GLuint colorNumber,
                                   GLuint index, const GLchar *name)
@@ -316,6 +331,21 @@ _mesa_BindFragDataLocationIndexed(GLuint program, GLuint colorNumber,
    bind_frag_data_location(shProg, name, colorNumber, index);
 }
 
+void GLAPIENTRY
+_mesa_BindFragDataLocationIndexed_no_error(GLuint program, GLuint colorNumber,
+                                           GLuint index, const GLchar *name)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (!name)
+      return;
+
+   struct gl_shader_program *const shProg =
+      _mesa_lookup_shader_program(ctx, program);
+
+   bind_frag_data_location(shProg, name, colorNumber, index);
+}
+
 GLint GLAPIENTRY
 _mesa_GetFragDataIndex(GLuint program, const GLchar *name)
 {
index b2229f7ced6a4b0903ebb26187fd1adc1bff113c..b7ba7ab84a6af0270ed606b53ad572ec46c12bf5 100644 (file)
@@ -157,6 +157,14 @@ extern void GLAPIENTRY
 _mesa_BindFragDataLocationIndexed(GLuint program, GLuint colorNumber,
                                   GLuint index, const GLchar *name);
 
+extern void GLAPIENTRY
+_mesa_BindFragDataLocation_no_error(GLuint program, GLuint colorNumber,
+                                    const GLchar *name);
+
+extern void GLAPIENTRY
+_mesa_BindFragDataLocationIndexed_no_error(GLuint program, GLuint colorNumber,
+                                           GLuint index, const GLchar *name);
+
 extern void GLAPIENTRY
 _mesa_GetActiveAttrib(GLuint, GLuint, GLsizei, GLsizei *, GLint *,
                          GLenum *, GLchar *);