diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/ir_constant_expression.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index f02cd3127ee..915d362b152 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -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; } |