glsl: Let the constructor figure out the types of switch-related expressions.
authorEric Anholt <eric@anholt.net>
Mon, 14 May 2012 15:39:54 +0000 (08:39 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 17 May 2012 17:05:24 +0000 (10:05 -0700)
I noticed this while unindenting the code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast_to_hir.cpp

index 9252df1495266fa4381c504d93b1d4e32a71e89a..513908a0dbdbbe20b66a2eb2f1b73156ba93c71b 100644 (file)
@@ -3731,7 +3731,6 @@ ast_case_label::hir(exec_list *instructions,
         new(ctx) ir_dereference_variable(state->switch_state.test_var);
 
       ir_rvalue *const test_cond = new(ctx) ir_expression(ir_binop_all_equal,
-                                                         glsl_type::bool_type,
                                                          label_const,
                                                          deref_test_var);
 
@@ -3788,9 +3787,7 @@ ast_iteration_statement::condition_to_hir(ir_loop *stmt,
          * like 'if (!condition) break;' as the loop termination condition.
          */
         ir_rvalue *const not_cond =
-           new(ctx) ir_expression(ir_unop_logic_not, glsl_type::bool_type,
-                                  cond,
-                                  NULL);
+           new(ctx) ir_expression(ir_unop_logic_not, cond);
 
         ir_if *const if_stmt = new(ctx) ir_if(not_cond);