From: Maxence Le Doré Date: Thu, 2 Jan 2014 23:09:50 +0000 (+0100) Subject: glsl: add min() and max() functions to builder.cpp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=61c450fc81900131621e57fdd78a40e82239daf3;p=mesa.git glsl: add min() and max() functions to builder.cpp Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index 6c49734bef8..31ed1916cc9 100644 --- a/src/glsl/ir_builder.cpp +++ b/src/glsl/ir_builder.cpp @@ -211,6 +211,16 @@ ir_expression *sub(operand a, operand b) return expr(ir_binop_sub, a, b); } +ir_expression *min(operand a, operand b) +{ + return expr(ir_binop_min, a, b); +} + +ir_expression *max(operand a, operand b) +{ + return expr(ir_binop_max, a, b); +} + ir_expression *mul(operand a, operand b) { return expr(ir_binop_mul, a, b); diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 1f0778870e3..4b85ea13958 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -184,6 +184,9 @@ ir_expression *i2b(operand a); ir_expression *f2b(operand a); ir_expression *b2f(operand a); +ir_expression *min(operand a, operand b); +ir_expression *max(operand a, operand b); + ir_expression *fma(operand a, operand b, operand c); ir_expression *lrp(operand x, operand y, operand a); ir_expression *csel(operand a, operand b, operand c);