From 60b57b609fe0f4b89c65fb9643be0ba9b0f31e55 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Fri, 29 May 2020 16:20:45 +0300 Subject: [PATCH] glsl: Don't replace lrp pattern with lrp if arguments are not floats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Witold Baryluk Reviewed-by: Marek Olšák Part-of: (cherry picked from commit 9f3956fea080d73d98fc28bc8cd148755b597b74) --- .pick_status.json | 2 +- src/compiler/glsl/opt_algebraic.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 2a9fd4f584c..cf1b1607cca 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2110,7 +2110,7 @@ "description": "glsl: Don't replace lrp pattern with lrp if arguments are not floats", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "8d37e9915a3b21b496269a39f677a80a6e02cb2c" }, diff --git a/src/compiler/glsl/opt_algebraic.cpp b/src/compiler/glsl/opt_algebraic.cpp index 226f6245fca..7cef4fc6ef9 100644 --- a/src/compiler/glsl/opt_algebraic.cpp +++ b/src/compiler/glsl/opt_algebraic.cpp @@ -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]; - 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;