diff options
author | Ian Romanick <[email protected]> | 2014-08-01 18:51:30 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-08-07 16:17:53 -0700 |
commit | 1c759e32d8782bae11148896231500727faa883a (patch) | |
tree | f243d6e1965980694d84783ebaa7a0d39d4803b5 /src/mesa/main/uniform_query.cpp | |
parent | e0c867372a2ff57944cfe1987550d29c4c509ebb (diff) |
mesa: Fold _mesa_uniform_split_location_offset into its only caller
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 2dc9f273b47..5989364935d 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -267,9 +267,7 @@ validate_uniform_parameters(struct gl_context *ctx, INACTIVE_UNIFORM_EXPLICIT_LOCATION) return NULL; - unsigned loc; - _mesa_uniform_split_location_offset(shProg, location, &loc, array_index); - struct gl_uniform_storage *const uni = &shProg->UniformStorage[loc]; + struct gl_uniform_storage *const uni = shProg->UniformRemapTable[location]; if (uni->array_elements == 0 && count > 1) { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -278,6 +276,11 @@ validate_uniform_parameters(struct gl_context *ctx, return NULL; } + /* The array index specified by the uniform location is just the uniform + * location minus the base location of of the uniform. + */ + *array_index = location - uni->remap_location; + /* If the uniform is an array, check that array_index is in bounds. * If not an array, check that array_index is zero. * array_index is unsigned so no need to check for less than zero. |