summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_algebraic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/opt_algebraic.cpp')
-rw-r--r--src/glsl/opt_algebraic.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp
index 44a21b6c335..70e016d22aa 100644
--- a/src/glsl/opt_algebraic.cpp
+++ b/src/glsl/opt_algebraic.cpp
@@ -415,6 +415,17 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
break;
+ case ir_triop_lrp:
+ /* Operands are (x, y, a). */
+ if (is_vec_zero(op_const[2])) {
+ this->progress = true;
+ return swizzle_if_required(ir, ir->operands[0]);
+ } else if (is_vec_one(op_const[2])) {
+ this->progress = true;
+ return swizzle_if_required(ir, ir->operands[1]);
+ }
+ break;
+
default:
break;
}