glsl: enable/disable certain lowering passes for doubles
authorDave Airlie <airlied@gmail.com>
Thu, 14 Aug 2014 08:44:50 +0000 (18:44 +1000)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 19 Feb 2015 05:28:35 +0000 (00:28 -0500)
We want to restrict some lowering passes to floats only,
and enable other for doubles.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/glsl/lower_instructions.cpp

index 09afe556454a662ef8ca4dbba19f32f9e3d0b687..5c1d6aae8fb2b372a2ab10eb770c6a36fe9a593d 100644 (file)
@@ -306,7 +306,7 @@ lower_instructions_visitor::mod_to_floor(ir_expression *ir)
    /* Don't generate new IR that would need to be lowered in an additional
     * pass.
     */
-   if (lowering(DIV_TO_MUL_RCP))
+   if (lowering(DIV_TO_MUL_RCP) && ir->type->is_float())
       div_to_mul_rcp(div_expr);
 
    ir_expression *const floor_expr =
@@ -548,7 +548,7 @@ lower_instructions_visitor::visit_leave(ir_expression *ir)
       break;
 
    case ir_binop_mod:
-      if (lowering(MOD_TO_FLOOR) && ir->type->is_float())
+      if (lowering(MOD_TO_FLOOR) && (ir->type->is_float() || ir->type->is_double()))
         mod_to_floor(ir);
       break;
 
@@ -563,7 +563,7 @@ lower_instructions_visitor::visit_leave(ir_expression *ir)
       break;
 
    case ir_binop_ldexp:
-      if (lowering(LDEXP_TO_ARITH))
+      if (lowering(LDEXP_TO_ARITH) && ir->type->is_float())
          ldexp_to_arith(ir);
       break;