[Mesa-dev] [PATCH 08/11] glsl: enable/disable certain lowering passes for doubles

Dave Airlie airlied at gmail.com
Thu Aug 14 03:52:39 PDT 2014


We want to restrict some lowering passes to floats only,
and enable other for doubles.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/glsl/lower_instructions.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/glsl/lower_instructions.cpp b/src/glsl/lower_instructions.cpp
index 176070c..eced619 100644
--- a/src/glsl/lower_instructions.cpp
+++ b/src/glsl/lower_instructions.cpp
@@ -290,7 +290,7 @@ lower_instructions_visitor::mod_to_fract(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_rvalue *expr = new(ir) ir_expression(ir_unop_fract,
@@ -511,7 +511,7 @@ lower_instructions_visitor::visit_leave(ir_expression *ir)
       break;
 
    case ir_binop_mod:
-      if (lowering(MOD_TO_FRACT) && ir->type->is_float())
+      if (lowering(MOD_TO_FRACT) && (ir->type->is_float() || ir->type->is_double()))
 	 mod_to_fract(ir);
       break;
 
@@ -526,7 +526,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;
 
-- 
1.9.3



More information about the mesa-dev mailing list