summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-04-10 10:42:13 -0700
committerIan Romanick <[email protected]>2012-05-23 11:42:07 -0700
commit76027f5b5cd8017f8455e2df375fcea7cc888dce (patch)
treee7068d415bae56245b192f933565fa595e01b07b /src/glsl
parentb610881317a7775a7ffe5f032099d8b2dc45eff0 (diff)
glsl: Propagate sampler uniform initializers to gl_shader_program::SamplerUnits
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/link_uniform_initializers.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/link_uniform_initializers.cpp b/src/glsl/link_uniform_initializers.cpp
index 46f05261f18..849e080970a 100644
--- a/src/glsl/link_uniform_initializers.cpp
+++ b/src/glsl/link_uniform_initializers.cpp
@@ -132,11 +132,20 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
idx += elements;
}
+
+ if (base_type == GLSL_TYPE_SAMPLER) {
+ for (unsigned int i = 0; i < storage->array_elements; i++) {
+ prog->SamplerUnits[storage->sampler + i] = storage->storage[i].i;
+ }
+ }
} else {
copy_constant_to_storage(storage->storage,
val,
val->type->base_type,
val->type->components());
+
+ if (storage->type->is_sampler())
+ prog->SamplerUnits[storage->sampler] = storage->storage[0].i;
}
storage->initialized = true;