From 16be6298c0d7aa1a06903e6768bc74358d339fba Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sun, 4 Aug 2013 14:09:09 -0700 Subject: glsl: Add abs() to ir_builder. Reviewed-by: Kenneth Graunke Reviewed-by: Chad Versace --- src/glsl/ir_builder.cpp | 6 ++++++ src/glsl/ir_builder.h | 1 + 2 files changed, 7 insertions(+) (limited to 'src/glsl') diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index 5e1da17a62f..06b6a8c87fb 100644 --- a/src/glsl/ir_builder.cpp +++ b/src/glsl/ir_builder.cpp @@ -219,6 +219,12 @@ saturate(operand a) new(mem_ctx) ir_constant(0.0f)); } +ir_expression * +abs(operand a) +{ + return expr(ir_unop_abs, a); +} + ir_expression* equal(operand a, operand b) { diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 59985beb2c6..49c2a7382da 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -133,6 +133,7 @@ ir_expression *round_even(operand a); ir_expression *dot(operand a, operand b); ir_expression *clamp(operand a, operand b, operand c); ir_expression *saturate(operand a); +ir_expression *abs(operand a); ir_expression *equal(operand a, operand b); ir_expression *less(operand a, operand b); -- cgit v1.2.3