glsl: Add plumbing for handling uniform binding qualifiers.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 18 Jul 2013 21:28:05 +0000 (14:28 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 18 Jul 2013 23:57:24 +0000 (16:57 -0700)
commit67038c6ba27ea55d8d65557922bfe758a01101ef
treedab073827cc2313a407689c949dfcd8150ca82a3
parent0a23ec2b6e3742281a0047da9246039e86e4a7b6
glsl: Add plumbing for handling uniform binding qualifiers.

Sampler uniforms and uniform blocks do not have a var->constant_value.
Instead, they have an integer var->binding value.

This makes extending set_uniform_initializer() somewhat problematic: it
assumes that there is an ir_constant * which represents the initializer,
and that it's safe to dereference that without any NULL checks.

Instead, this patch creates an analogous function for binding
qualifiers, and calls one or the other as appropriate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/link_uniform_initializers.cpp