diff options
author | Tapani Pälli <[email protected]> | 2014-03-06 11:00:17 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2014-03-10 09:46:24 +0200 |
commit | 56b1be4399d76c0fe5ddf099a7ac5b45ab58e8cf (patch) | |
tree | 0ee265183905dec2e7c8d5679c5014e07f1bdb21 /src/mesa/main/shaderobj.c | |
parent | aa0d95a08dbf8f0e3ed66b624ccbc60753b61ef1 (diff) |
mesa/glsl: introduce a remap table for uniform locations
Patch adds a remap table for uniforms that is used to provide a mapping
from application specified uniform location to actual location in the
UniformStorage. Existing UniformLocationBaseScale usage is removed as
table can be used to set sequential values for array uniform elements.
This mapping helps to implement GL_ARB_explicit_uniform_location so that
uniforms locations can be reorganized and handled in a more easy manner.
v2: small fixes + rename parameters for merge and split functions (Ian)
improve documentation, remove old check for location bounds (Eric)
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r-- | src/mesa/main/shaderobj.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index d5c3d8099a7..b0f0bfa915b 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -285,7 +285,12 @@ _mesa_clear_shader_program_data(struct gl_context *ctx, ralloc_free(shProg->UniformStorage); shProg->NumUserUniformStorage = 0; shProg->UniformStorage = NULL; - shProg->UniformLocationBaseScale = 0; + } + + if (shProg->UniformRemapTable) { + ralloc_free(shProg->UniformRemapTable); + shProg->NumUniformRemapTable = 0; + shProg->UniformRemapTable = NULL; } if (shProg->UniformHash) { |