mesa: add KHR_no_error support for glGetUniformLocation()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 28 Jun 2017 04:34:14 +0000 (14:34 +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/uniforms.c
src/mesa/main/uniforms.h

index 8a8f15b9dd420af180a6fa7f152ea92204606f95..f726fe3477db9d98e50d166dbeaff0ed4f122f59 100644 (file)
         <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"/>
index 194f64a3b2c85dce159ad41c520bc5b1c5d3fff0..ddfe9064c2d43cd453a7554989808015e4638dd0 100644 (file)
@@ -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)
index 1cee90d2a776bfe13abacdd8a2f50af750fcbcd4..9236db97805b1d5eec84607424d1aecd8d097cbe 100644 (file)
@@ -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);