From: Kenneth Graunke Date: Wed, 17 Jul 2013 18:45:57 +0000 (-0700) Subject: glsl: Delete unused code for handling samplers in array-initializers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a23ec2b6e3742281a0047da9246039e86e4a7b6;p=mesa.git glsl: Delete unused code for handling samplers in array-initializers. There is existing code to handle sampler uniform initializers. Prior to GLSL 4.20's "binding" keyword, sampler uniforms don't have initializers at all, so this is somewhat surprising. The existing code is broken into two cases: one where both the variable and initializer are arrays, and a second where the variable and initializer are scalars. The first case should never occur, since array-typed initializers do not exist for sampler uniforms. Even with the binding keyword, the initializer is a single integer which represents the texture unit to use for the first array element. The second is apparently used for some fixed-function code. v2: Rewrite the commit message - suggested by Paul. Signed-off-by: Kenneth Graunke Reviewed-by: Paul Berry --- diff --git a/src/glsl/link_uniform_initializers.cpp b/src/glsl/link_uniform_initializers.cpp index 54d9bf1f528..f46f6e2db15 100644 --- a/src/glsl/link_uniform_initializers.cpp +++ b/src/glsl/link_uniform_initializers.cpp @@ -136,20 +136,6 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, idx += elements; } - - if (base_type == GLSL_TYPE_SAMPLER) { - for (int sh = 0; sh < MESA_SHADER_TYPES; sh++) { - gl_shader *shader = prog->_LinkedShaders[sh]; - - if (shader && storage->sampler[sh].active) { - for (unsigned i = 0; i < storage->array_elements; i++) { - unsigned index = storage->sampler[sh].index + i; - - shader->SamplerUnits[index] = storage->storage[i].i; - } - } - } - } } else { copy_constant_to_storage(storage->storage, val,