summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_builder.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-09-03 16:46:05 -0700
committerKenneth Graunke <[email protected]>2013-09-09 11:52:22 -0700
commit202238824bdde9ddac5753232eee4f3d1e2d67db (patch)
treeadcd1ab7cb6a9a00c029f0cb81e533e455c3f02e /src/glsl/ir_builder.h
parentd716b3376ccf66200d007852b30147ca7f7e7c68 (diff)
glsl: Add a new ir_builder::dotlike() function.
dotlike() uses ir_binop_mul for scalars, and ir_binop_dot for vectors. When generating built-in functions, we often want to use regular multiply for scalar signatures, and dot() for vector signatures. ir_binop_dot only works on vectors, so we have to switch opcodes, even if the code is otherwise identical. dotlike() makes this easy. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ir_builder.h')
-rw-r--r--src/glsl/ir_builder.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h
index d423fc5954d..6d32d7a68b9 100644
--- a/src/glsl/ir_builder.h
+++ b/src/glsl/ir_builder.h
@@ -136,6 +136,7 @@ ir_expression *mul(operand a, operand b);
ir_expression *div(operand a, operand b);
ir_expression *round_even(operand a);
ir_expression *dot(operand a, operand b);
+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);