summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-04-09 12:54:34 -1000
committerEric Anholt <[email protected]>2011-04-13 15:48:26 -0700
commit175829f1a8ab0df7594131cc569462e45c1974ec (patch)
tree023e2b561a2f4f0b1c75a3e35e3923eb4bc5226f /src
parent9e04b190b5f59c5b375645f5756a6edd98a7f90c (diff)
glsl: When we've emitted a semantic error for ==, return a bool constant.
This prevents later errors (including an assertion failure) from cascading the failure. Fixes invalid-equality-04.vert. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33303 Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast_to_hir.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 108c7c35d37..ea20ebae114 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1073,10 +1073,14 @@ ast_expression::hir(exec_list *instructions,
error_emitted = true;
}
- result = do_comparison(ctx, operations[this->oper], op[0], op[1]);
- type = glsl_type::bool_type;
+ if (error_emitted) {
+ result = new(ctx) ir_constant(false);
+ } else {
+ result = do_comparison(ctx, operations[this->oper], op[0], op[1]);
+ assert(result->type == glsl_type::bool_type);
+ type = glsl_type::bool_type;
+ }
- assert(error_emitted || (result->type == glsl_type::bool_type));
break;
case ast_bit_and: