[Mesa-dev] [PATCH 3/6] mesa: Use glsl_type::gl_type in glGetActiveUniform

Ian Romanick idr at freedesktop.org
Fri Oct 7 17:06:49 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

This has the same value has gl_program_parameter::DataType field.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/main/uniform_query.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 3164d72..ba7d759 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -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;
    }
 }
-- 
1.7.6



More information about the mesa-dev mailing list