summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderobj.c
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2014-03-06 11:00:17 +0200
committerTapani Pälli <tapani.palli@intel.com>2014-03-10 09:46:24 +0200
commit56b1be4399d76c0fe5ddf099a7ac5b45ab58e8cf (patch)
tree0ee265183905dec2e7c8d5679c5014e07f1bdb21 /src/mesa/main/shaderobj.c
parentaa0d95a08dbf8f0e3ed66b624ccbc60753b61ef1 (diff)
downloadexternal_mesa3d-56b1be4399d76c0fe5ddf099a7ac5b45ab58e8cf.zip
external_mesa3d-56b1be4399d76c0fe5ddf099a7ac5b45ab58e8cf.tar.gz
external_mesa3d-56b1be4399d76c0fe5ddf099a7ac5b45ab58e8cf.tar.bz2
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 <tapani.palli@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r--src/mesa/main/shaderobj.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index d5c3d80..b0f0bfa 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) {