glsl: Don't replace lrp pattern with lrp if arguments are not floats
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Fri, 29 May 2020 13:20:45 +0000 (16:20 +0300)
committerMarge Bot <eric+marge@anholt.net>
Wed, 3 Jun 2020 09:06:25 +0000 (09:06 +0000)
We don't have "lrp(int, int, int)" and validation of ir_triop_lrp
fails down the road.

Fixes: 8d37e991
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3059
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5257>

src/compiler/glsl/opt_algebraic.cpp

index 226f6245fca79a48452a9b202fe4d9dbc42997cb..7cef4fc6ef934f12b306a64d129ddc97f48ae386 100644 (file)
@@ -578,7 +578,8 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
                ir_rvalue *y_operand = inner_add->operands[1 - neg_pos];
                ir_rvalue *a_operand = mul->operands[1 - inner_add_pos];
 
                ir_rvalue *y_operand = inner_add->operands[1 - neg_pos];
                ir_rvalue *a_operand = mul->operands[1 - inner_add_pos];
 
-               if (x_operand->type != y_operand->type ||
+               if (!x_operand->type->is_float_16_32_64() ||
+                   x_operand->type != y_operand->type ||
                    x_operand->type != a_operand->type)
                   continue;
 
                    x_operand->type != a_operand->type)
                   continue;