mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
glsl: Only set ir_variable::constant_value for const-decorated variables
Right now we're also setting for uniforms, and that doesn't seem to hurt
things. The next patch will make general global variables in GLSL ES,
and those definitely should not have constant_value set!
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3524d6df33)
This commit is contained in:
parent
0c6b210749
commit
2d5b8efd7d
1 changed files with 6 additions and 3 deletions
|
|
@ -3171,17 +3171,20 @@ process_initializer(ir_variable *var, ast_declaration *decl,
|
|||
decl->identifier);
|
||||
if (var->type->is_numeric()) {
|
||||
/* Reduce cascading errors. */
|
||||
var->constant_value = ir_constant::zero(state, var->type);
|
||||
var->constant_value = type->qualifier.flags.q.constant
|
||||
? ir_constant::zero(state, var->type) : NULL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rhs = constant_value;
|
||||
var->constant_value = constant_value;
|
||||
var->constant_value = type->qualifier.flags.q.constant
|
||||
? constant_value : NULL;
|
||||
}
|
||||
} else {
|
||||
if (var->type->is_numeric()) {
|
||||
/* Reduce cascading errors. */
|
||||
var->constant_value = ir_constant::zero(state, var->type);
|
||||
var->constant_value = type->qualifier.flags.q.constant
|
||||
? ir_constant::zero(state, var->type) : NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue