diff options
author | Ian Romanick <[email protected]> | 2015-09-01 10:29:04 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2017-01-26 09:46:07 -0800 |
commit | 874393186b43f80ebd5921e3eb909aeec415e7c5 (patch) | |
tree | 5fe21a44ec6a7c93b83f4e784cae6166b83dfbfc /src/mesa | |
parent | bbe8705c579c3e464615a0ca9b2eb4bd3c16aad3 (diff) |
mesa: Trivial clean-ups in uniform_query.cpp
This is C++, so we can mix code and declarations. Doing so allows
constification.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Plamena Manolova <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index d5a2d0f58bc..c2429c12e10 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -992,10 +992,6 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg, const GLvoid *values, enum glsl_base_type basicType) { unsigned offset; - unsigned vectors; - unsigned components; - unsigned elements; - int size_mul; struct gl_uniform_storage *const uni = validate_uniform_parameters(ctx, shProg, location, count, &offset, "glUniformMatrix"); @@ -1009,11 +1005,11 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg, } assert(basicType == GLSL_TYPE_FLOAT || basicType == GLSL_TYPE_DOUBLE); - size_mul = basicType == GLSL_TYPE_DOUBLE ? 2 : 1; + const unsigned size_mul = basicType == GLSL_TYPE_DOUBLE ? 2 : 1; assert(!uni->type->is_sampler()); - vectors = uni->type->matrix_columns; - components = uni->type->vector_elements; + const unsigned vectors = uni->type->matrix_columns; + const unsigned components = uni->type->vector_elements; /* Verify that the types are compatible. This is greatly simplified for * matrices because they can only have a float base type. @@ -1084,7 +1080,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg, /* Store the data in the "actual type" backing storage for the uniform. */ - elements = components * vectors; + const unsigned elements = components * vectors; if (!transpose) { memcpy(&uni->storage[size_mul * elements * offset], values, |