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.
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index f02cd31..915d362 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -674,6 +674,12 @@
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;
}