glsl: Set initial values for uniforms in the linker

v2: Fix handling of arrays-of-structure.  Thanks to Eric Anholt for
pointing this out.

v3: Minor comment change based on feedback from Ken.

Fixes piglit glsl-1.20/execution/uniform-initializer/fs-structure-array
and glsl-1.20/execution/uniform-initializer/vs-structure-array.

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:
Ian Romanick
2012-04-06 14:06:13 -07:00
parent 29362875f2
commit a2e623054b
4 changed files with 178 additions and 0 deletions

View File

@@ -37,6 +37,9 @@ link_invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode,
extern void
link_assign_uniform_locations(struct gl_shader_program *prog);
extern void
link_set_uniform_initializers(struct gl_shader_program *prog);
/**
* Class for processing all of the leaf fields of an uniform
*