From 51313f567d59afd5491e03d1593030066df974eb Mon Sep 17 00:00:00 2001 From: Tapani Pälli Date: Thu, 12 Mar 2015 14:31:15 +0200 Subject: mesa: refactor GetUniformLocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use _mesa_program_resource_location to get location. Signed-off-by: Tapani Pälli Reviewed-by: Martin Peres --- src/mesa/main/uniforms.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src') diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index 8872344e7bc..0c16641533c 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -911,7 +911,6 @@ GLint GLAPIENTRY _mesa_GetUniformLocation(GLuint programObj, const GLcharARB *name) { struct gl_shader_program *shProg; - GLuint index, offset; GET_CURRENT_CONTEXT(ctx); @@ -931,23 +930,7 @@ _mesa_GetUniformLocation(GLuint programObj, const GLcharARB *name) return -1; } - index = _mesa_get_uniform_location(shProg, name, &offset); - if (index == GL_INVALID_INDEX) - return -1; - - /* From the GL_ARB_uniform_buffer_object spec: - * - * "The value -1 will be returned if does not correspond to an - * active uniform variable name in , if is associated - * with a named uniform block, or if starts with the reserved - * prefix "gl_"." - */ - if (shProg->UniformStorage[index].block_index != -1 || - shProg->UniformStorage[index].atomic_buffer_index != -1) - return -1; - - /* location in remap table + array element offset */ - return shProg->UniformStorage[index].remap_location + offset; + return _mesa_program_resource_location(shProg, GL_UNIFORM, name); } GLuint GLAPIENTRY -- cgit v1.2.3