[Mesa-dev] [PATCH 5/5] mesa: Slightly clean up the other GetUniform paths using the local values[].

Eric Anholt eric at anholt.net
Fri Aug 19 17:56:06 PDT 2011


---
 src/mesa/main/uniforms.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index fbaa810..e2a9e93 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -463,10 +463,8 @@ get_uniform(struct gl_context *ctx, GLuint program, GLint location,
             GLfloat *params = (GLfloat *) paramsOut;
             k = 0;
             for (i = 0; i < rows; i++) {
-               const int base = paramPos + offset + i;
                for (j = 0; j < cols; j++ ) {
-                  params[k++] = (GLdouble)
-                     prog->Parameters->ParameterValues[base][j].f;
+                  params[k++] = values[i][j].f;
                }
             }
          }
@@ -476,11 +474,9 @@ get_uniform(struct gl_context *ctx, GLuint program, GLint location,
             GLint *params = (GLint *) paramsOut;
             k = 0;
             for (i = 0; i < rows; i++) {
-               const int base = paramPos + offset + i;
                for (j = 0; j < cols; j++ ) {
                   params[k++] = ctx->Const.NativeIntegers ?
-                     prog->Parameters->ParameterValues[base][j].i :
-                     (GLint) prog->Parameters->ParameterValues[base][j].f;
+                     values[i][j].i : values[i][j].f;
                }
             }
          }
@@ -490,11 +486,9 @@ get_uniform(struct gl_context *ctx, GLuint program, GLint location,
             GLuint *params = (GLuint *) paramsOut;
             k = 0;
             for (i = 0; i < rows; i++) {
-               const int base = paramPos + offset + i;
                for (j = 0; j < cols; j++ ) {
                   params[k++] = ctx->Const.NativeIntegers ?
-                     prog->Parameters->ParameterValues[base][j].u :
-                     (GLuint) prog->Parameters->ParameterValues[base][j].f;
+                     values[i][j].u : values[i][j].f;
                }
             }
          }
-- 
1.7.5.4



More information about the mesa-dev mailing list