glsl2: Don't consider uniform initializers as constant expressions.

We were happily optimizing away the body of
glsl-uniform-initializer-* to never use the uniforms.
This commit is contained in:
Eric Anholt
2010-08-02 15:31:28 -07:00
parent b10bb527ea
commit 5704ed27dd

View File

@@ -674,6 +674,12 @@ ir_dereference_variable::constant_expression_value()
if (!var)
return NULL;
/* The constant_value of a uniform variable is its initializer,
* not the lifetime constant value of the uniform.
*/
if (var->mode == ir_var_uniform)
return NULL;
return var->constant_value ? var->constant_value->clone(NULL) : NULL;
}