[Mesa-dev] [PATCH 12/14] mesa: add KHR_no_error support for glBindFragDataLocation*()

Timothy Arceri tarceri at itsqueeze.com
Wed Jun 28 06:13:50 UTC 2017


---
 src/mapi/glapi/gen/ARB_blend_func_extended.xml |  2 +-
 src/mapi/glapi/gen/GL3x.xml                    |  2 +-
 src/mesa/main/shader_query.cpp                 | 24 ++++++++++++++++++++++++
 src/mesa/main/shaderapi.h                      |  8 ++++++++
 4 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_blend_func_extended.xml b/src/mapi/glapi/gen/ARB_blend_func_extended.xml
index 406140f..10d85a7 100644
--- a/src/mapi/glapi/gen/ARB_blend_func_extended.xml
+++ b/src/mapi/glapi/gen/ARB_blend_func_extended.xml
@@ -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"/>
diff --git a/src/mapi/glapi/gen/GL3x.xml b/src/mapi/glapi/gen/GL3x.xml
index f488ba3..24490da 100644
--- a/src/mapi/glapi/gen/GL3x.xml
+++ b/src/mapi/glapi/gen/GL3x.xml
@@ -200,7 +200,7 @@
       <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 *"/>
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index d571846..2b9eb23 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -259,6 +259,18 @@ _mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
 }
 
 void GLAPIENTRY
+_mesa_BindFragDataLocation_no_error(GLuint program, GLuint colorNumber,
+                                    const GLchar *name)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   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)
 {
@@ -295,6 +307,18 @@ _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);
+
+   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)
 {
diff --git a/src/mesa/main/shaderapi.h b/src/mesa/main/shaderapi.h
index 0a28185..500d8ed 100644
--- a/src/mesa/main/shaderapi.h
+++ b/src/mesa/main/shaderapi.h
@@ -148,6 +148,14 @@ _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 *);
 
-- 
2.9.4



More information about the mesa-dev mailing list