mesa: Use glsl_type::gl_type in glGetActiveUniform
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 7 Sep 2011 17:41:32 +0000 (10:41 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 19 Oct 2011 00:26:38 +0000 (17:26 -0700)
This has the same value has gl_program_parameter::DataType field.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/uniform_query.cpp

index 3164d7203decab6876f3672af626c596f094f7d2..ba7d7591f1544231226160894ab48936e71cb1b3 100644 (file)
@@ -54,12 +54,14 @@ _mesa_GetActiveUniformARB(GLhandleARB program, GLuint index,
    if (!param)
       return;
 
+   const struct gl_uniform *const uni = &shProg->Uniforms->Uniforms[index];
+
    if (nameOut) {
       _mesa_copy_string(nameOut, maxLength, length, param->Name);
    }
 
    if (size) {
-      GLint typeSize = _mesa_sizeof_glsl_type(param->DataType);
+      GLint typeSize = _mesa_sizeof_glsl_type(uni->Type->gl_type);
       if ((GLint) param->Size > typeSize) {
          /* This is an array.
           * Array elements are placed on vector[4] boundaries so they're
@@ -73,6 +75,6 @@ _mesa_GetActiveUniformARB(GLhandleARB program, GLuint index,
    }
 
    if (type) {
-      *type = param->DataType;
+      *type = uni->Type->gl_type;
    }
 }