diff options
author | Ian Romanick <[email protected]> | 2014-08-01 18:53:09 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-08-07 16:17:55 -0700 |
commit | 89d92fc00e52ac0f9d5bb1edf81660ab93816f1b (patch) | |
tree | df72d67968744389efe9cb6a54f026cc0f037cac /src/mesa/main/uniforms.h | |
parent | 1c759e32d8782bae11148896231500727faa883a (diff) |
mesa: Fold _mesa_uniform_merge_location_offset into its only caller
Also delete the comment before that function. Everything in that
comment was either stale, wrong, or captured elsewhere.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/uniforms.h')
-rw-r--r-- | src/mesa/main/uniforms.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h index 3e1648380bc..e7a370e84ff 100644 --- a/src/mesa/main/uniforms.h +++ b/src/mesa/main/uniforms.h @@ -323,50 +323,6 @@ struct gl_builtin_uniform_desc { unsigned int num_elements; }; -/** - * \name GLSL uniform arrays and structs require special handling. - * - * The GL_ARB_shader_objects spec says that if you use - * glGetUniformLocation to get the location of an array, you CANNOT - * access other elements of the array by adding an offset to the - * returned location. For example, you must call - * glGetUniformLocation("foo[16]") if you want to set the 16th element - * of the array with glUniform(). - * - * HOWEVER, some other OpenGL drivers allow accessing array elements - * by adding an offset to the returned array location. And some apps - * seem to depend on that behaviour. - * - * Mesa's gl_uniform_list doesn't directly support this since each - * entry in the list describes one uniform variable, not one uniform - * element. We could insert dummy entries in the list for each array - * element after [0] but that causes complications elsewhere. - * - * We solve this problem by creating multiple entries for uniform arrays - * in the UniformRemapTable so that their elements get sequential locations. - * - * Utility functions below offer functionality to split UniformRemapTable - * location in to location of the uniform in UniformStorage + offset to the - * array element (0 if not an array) and also merge it back again as the - * UniformRemapTable location. - * - */ -/*@{*/ -/** - * Combine the uniform's storage index and the array index - */ -static inline GLint -_mesa_uniform_merge_location_offset(const struct gl_shader_program *prog, - unsigned storage_index, - unsigned uniform_array_index) -{ - /* location in remap table + array element offset */ - return prog->UniformStorage[storage_index].remap_location + - uniform_array_index; -} -/*@}*/ - - #ifdef __cplusplus } #endif |