[Mesa-dev] [PATCH 10/14] mesa: add KHR_no_error support for glGetUniformLocation()

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


---
 src/mapi/glapi/gen/gl_API.xml |  2 +-
 src/mesa/main/uniforms.c      | 11 +++++++++++
 src/mesa/main/uniforms.h      |  2 ++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 17fea47..d545050 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -5427,7 +5427,7 @@
         <glx ignore="true"/>
     </function>
 
-    <function name="GetUniformLocation" es2="2.0">
+    <function name="GetUniformLocation" es2="2.0" no_error="true">
         <param name="program" type="GLuint"/>
         <param name="name" type="const GLchar *"/>
         <return type="GLint"/>
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 71acb28..8496583 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -1025,6 +1025,17 @@ _mesa_GetUniformLocation(GLuint programObj, const GLcharARB *name)
    return _mesa_program_resource_location(shProg, GL_UNIFORM, name);
 }
 
+GLint GLAPIENTRY
+_mesa_GetUniformLocation_no_error(GLuint programObj, const GLcharARB *name)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program(ctx, programObj);
+
+   return _mesa_program_resource_location(shProg, GL_UNIFORM, name);
+}
+
 GLuint GLAPIENTRY
 _mesa_GetUniformBlockIndex(GLuint program,
 			   const GLchar *uniformBlockName)
diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h
index ebeaf9d..3ec607e 100644
--- a/src/mesa/main/uniforms.h
+++ b/src/mesa/main/uniforms.h
@@ -224,6 +224,8 @@ void GLAPIENTRY
 _mesa_GetUniformdv(GLuint, GLint, GLdouble *);
 GLint GLAPIENTRY
 _mesa_GetUniformLocation(GLuint, const GLcharARB *);
+GLint GLAPIENTRY
+_mesa_GetUniformLocation_no_error(GLuint, const GLcharARB *);
 GLuint GLAPIENTRY
 _mesa_GetUniformBlockIndex(GLuint program,
 			   const GLchar *uniformBlockName);
-- 
2.9.4



More information about the mesa-dev mailing list