summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2017-08-15 13:47:08 -0400
committerEmil Velikov <[email protected]>2017-08-19 01:42:08 +0100
commit47507ec1fd3f0811ca6e82ba9428cbb8a44e63bb (patch)
tree298824ff145354b43f63f869844c499f06dee32e
parent3fb5cc263733590857ff56be92e79a45b223d57c (diff)
glsl/ast: update rhs in addition to the var's constant_value
We continue in the code to do some more things with the rhs, including setting a constant initializer. If the type is wrong, this causes some confusion down the line, leading to assertions. This makes sure that the rhs processing continues to flow as-if the type was correct to start with (even though the state has been marked as an error state). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101766 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected] (cherry picked from commit 978c4c597aa48e65bd6822a85e6b8f82ca9281f1)
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 4916b1590a0..73d8d6298df 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4495,7 +4495,7 @@ process_initializer(ir_variable *var, ast_declaration *decl,
} else {
if (var->type->is_numeric()) {
/* Reduce cascading errors. */
- var->constant_value = type->qualifier.flags.q.constant
+ rhs = var->constant_value = type->qualifier.flags.q.constant
? ir_constant::zero(state, var->type) : NULL;
}
}