mesa: refactor GetActiveUniformName
authorTapani Pälli <tapani.palli@intel.com>
Thu, 12 Mar 2015 11:22:16 +0000 (13:22 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 16 Apr 2015 04:55:57 +0000 (07:55 +0300)
Use _mesa_get_program_resource_name to get name.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
src/mesa/main/uniforms.c

index dc9b5a02b5c450781e7d66a36484f7df08083e92..69f8a3fc0b6ba15aaaec8f01138848f87cd7ee68 100644 (file)
@@ -1226,15 +1226,8 @@ _mesa_GetActiveUniformName(GLuint program, GLuint uniformIndex,
    if (!shProg)
       return;
 
-   if (uniformIndex >= shProg->NumUserUniformStorage) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform(index)");
-      return;
-   }
-
-   if (uniformName) {
-      _mesa_get_uniform_name(& shProg->UniformStorage[uniformIndex],
-                             bufSize, length, uniformName);
-   }
+   _mesa_get_program_resource_name(shProg, GL_UNIFORM, uniformIndex, bufSize,
+                                   length, uniformName, "glGetActiveUniformName");
 }
 
 void