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:
@@ -674,6 +674,12 @@ ir_dereference_variable::constant_expression_value()
|
|||||||
if (!var)
|
if (!var)
|
||||||
return NULL;
|
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;
|
return var->constant_value ? var->constant_value->clone(NULL) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user