From 7aaa38728f93bfb69573e0d866f24e8cb41836f0 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 19 Aug 2013 10:45:46 -0700 Subject: glsl: Add conditional-select IR. It's a ?: that operates per-component on vectors. Will be used in upcoming lowering pass for ldexp and the implementation of frexp. csel(selector, a, b): per-component result = selector ? a : b Reviewed-by: Kenneth Graunke Reviewed-by: Ian Romanick --- src/glsl/ir_builder.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/glsl/ir_builder.cpp') diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index ba14cf3744b..98b43229508 100644 --- a/src/glsl/ir_builder.cpp +++ b/src/glsl/ir_builder.cpp @@ -492,6 +492,12 @@ lrp(operand x, operand y, operand a) return expr(ir_triop_lrp, x, y, a); } +ir_expression * +csel(operand a, operand b, operand c) +{ + return expr(ir_triop_csel, a, b, c); +} + ir_expression * bitfield_insert(operand a, operand b, operand c, operand d) { -- cgit v1.2.3