mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
glsl: Propagate sampler uniform initializers to gl_shader_program::SamplerUnits
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
b610881317
commit
76027f5b5c
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue