summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2017-08-15 13:47:08 -0400
committerIlia Mirkin <[email protected]>2017-08-15 22:14:05 -0400
commit978c4c597aa48e65bd6822a85e6b8f82ca9281f1 (patch)
tree47d97dc7afdac57a359fa6bf7a3df9a77acd5777 /src
parent98983503cbc8adb2d66f8b031e205fefcf5b6278 (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]
Diffstat (limited to 'src')
-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 a07c0ecf953..f0a96c3e1e8 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4500,7 +4500,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;
}
}