glsl: fix uniform linking logic in the presence of structs
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 10 Feb 2015 08:02:09 +0000 (03:02 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 19 Feb 2015 05:28:34 +0000 (00:28 -0500)
commit53bf7c8fd2e11a6c64d6ff3a98b56d64d2242505
tree7214d2697606da847ffbaa0ba6878c125efdd1dd
parent1ec715ce8b126da3cfe3b383054f9a176960c218
glsl: fix uniform linking logic in the presence of structs

Add a enter/leave record callback so that the offset may be aligned to
the proper value. Otherwise only leaf fields are called, and the first
field needs to be aligned to the outer struct's base alignment while the
last field needs to be aligned to the inner struct's base alignment.

This removes most usage of the last field/record type values passed into
visit_field.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/glsl/link_uniform_blocks.cpp
src/glsl/link_uniforms.cpp
src/glsl/linker.h