diff options
-rw-r--r-- | src/glsl/ir_builder.cpp | 80 | ||||
-rw-r--r-- | src/glsl/ir_builder.h | 14 |
2 files changed, 94 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index e12ae3cf53f..ba14cf3744b 100644 --- a/src/glsl/ir_builder.cpp +++ b/src/glsl/ir_builder.cpp @@ -264,6 +264,54 @@ abs(operand a) return expr(ir_unop_abs, a); } +ir_expression * +neg(operand a) +{ + return expr(ir_unop_neg, a); +} + +ir_expression * +sin(operand a) +{ + return expr(ir_unop_sin, a); +} + +ir_expression * +cos(operand a) +{ + return expr(ir_unop_cos, a); +} + +ir_expression * +exp(operand a) +{ + return expr(ir_unop_exp, a); +} + +ir_expression * +rsq(operand a) +{ + return expr(ir_unop_rsq, a); +} + +ir_expression * +sqrt(operand a) +{ + return expr(ir_unop_sqrt, a); +} + +ir_expression * +log(operand a) +{ + return expr(ir_unop_log, a); +} + +ir_expression * +sign(operand a) +{ + return expr(ir_unop_sign, a); +} + ir_expression* equal(operand a, operand b) { @@ -420,6 +468,38 @@ b2i(operand a) return expr(ir_unop_b2i, a); } +ir_expression * +f2b(operand a) +{ + return expr(ir_unop_f2b, a); +} + +ir_expression * +b2f(operand a) +{ + return expr(ir_unop_b2f, a); +} + +ir_expression * +fma(operand a, operand b, operand c) +{ + return expr(ir_triop_fma, a, b, c); +} + +ir_expression * +lrp(operand x, operand y, operand a) +{ + return expr(ir_triop_lrp, x, y, a); +} + +ir_expression * +bitfield_insert(operand a, operand b, operand c, operand d) +{ + void *mem_ctx = ralloc_parent(a.val); + return new(mem_ctx) ir_expression(ir_quadop_bitfield_insert, + a.val->type, a.val, b.val, c.val, d.val); +} + ir_if* if_tree(operand condition, ir_instruction *then_branch) diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 091cf400b4a..36ae7125871 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -140,6 +140,14 @@ ir_expression *dotlike(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 *neg(operand a); +ir_expression *sin(operand a); +ir_expression *cos(operand a); +ir_expression *exp(operand a); +ir_expression *rsq(operand a); +ir_expression *sqrt(operand a); +ir_expression *log(operand a); +ir_expression *sign(operand a); ir_expression *equal(operand a, operand b); ir_expression *nequal(operand a, operand b); @@ -170,6 +178,12 @@ ir_expression *i2u(operand a); ir_expression *u2i(operand a); ir_expression *b2i(operand a); ir_expression *i2b(operand a); +ir_expression *f2b(operand a); +ir_expression *b2f(operand a); + +ir_expression *fma(operand a, operand b, operand c); +ir_expression *lrp(operand x, operand y, operand a); +ir_expression *bitfield_insert(operand a, operand b, operand c, operand d); ir_swizzle *swizzle(operand a, int swizzle, int components); /** |