summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniforms.c
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2015-03-12 14:31:15 +0200
committerTapani Pälli <tapani.palli@intel.com>2015-04-16 07:55:57 +0300
commit51313f567d59afd5491e03d1593030066df974eb (patch)
tree34c3e21fe420d3adc6203d028a447ea62e837ec9 /src/mesa/main/uniforms.c
parent45637e9c1f47df8cc8284b39b18f6b5f2e14aae9 (diff)
downloadexternal_mesa3d-51313f567d59afd5491e03d1593030066df974eb.zip
external_mesa3d-51313f567d59afd5491e03d1593030066df974eb.tar.gz
external_mesa3d-51313f567d59afd5491e03d1593030066df974eb.tar.bz2
mesa: refactor GetUniformLocation
Use _mesa_program_resource_location to get location. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Diffstat (limited to 'src/mesa/main/uniforms.c')
-rw-r--r--src/mesa/main/uniforms.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 8872344..0c16641 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 <name> does not correspond to an
- * active uniform variable name in <program>, if <name> is associated
- * with a named uniform block, or if <name> 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