[Mesa-dev] [PATCH v2 19/24] mesa: refactor GetActiveUniformName

Tapani Pälli tapani.palli at intel.com
Wed Apr 1 05:14:35 PDT 2015


Use _mesa_get_program_resource_name to get name.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/mesa/main/uniforms.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index dc9b5a0..69f8a3f 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -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
-- 
2.1.0



More information about the mesa-dev mailing list