Mesa (master): glsl: Don't replace lrp pattern with lrp if arguments are not floats

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 3 09:38:40 UTC 2020


Module: Mesa
Branch: master
Commit: 9f3956fea080d73d98fc28bc8cd148755b597b74
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f3956fea080d73d98fc28bc8cd148755b597b74

Author: Danylo Piliaiev <danylo.piliaiev at globallogic.com>
Date:   Fri May 29 16:20:45 2020 +0300

glsl: Don't replace lrp pattern with lrp if arguments are not floats

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 at globallogic.com>
Tested-by: Witold Baryluk <witold.baryluk at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5257>

---

 src/compiler/glsl/opt_algebraic.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
 



More information about the mesa-commit mailing list