summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-07-21 11:23:51 -0700
committerCarl Worth <cworth@cworth.org>2010-07-21 11:32:41 -0700
commit2be21100301eda076e36b019847e7f83a16d8014 (patch)
treec560a7f04c05173f5868c024b5d313b2153343cf
parenta26648f9296989f4d2df05318c723f7ff58df1d7 (diff)
glsl: Correctly handle unary plus operator.glsl2
Previously, any occurence of the unary plus operator would trigger a bogus type mismatch error. Fix this by making the ast_plus case look more like the ast_neg case as far as type-checking is concerned. With this change the shaders/CorrectPreprocess8.frag test in piglit now passes.
-rw-r--r--src/glsl/ast_to_hir.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 98090d2b01..59ac95b8f0 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -659,9 +659,9 @@ ast_expression::hir(exec_list *instructions,
case ast_plus:
op[0] = this->subexpressions[0]->hir(instructions, state);
- error_emitted = op[0]->type->is_error();
- if (type->is_error())
- op[0]->type = type;
+ type = unary_arithmetic_result_type(op[0]->type, state, & loc);
+
+ error_emitted = type->is_error();
result = op[0];
break;