glsl: Add a new ir_builder::dotlike() function.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 3 Sep 2013 23:46:05 +0000 (16:46 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 9 Sep 2013 18:52:22 +0000 (11:52 -0700)
commit202238824bdde9ddac5753232eee4f3d1e2d67db
treeadcd1ab7cb6a9a00c029f0cb81e533e455c3f02e
parentd716b3376ccf66200d007852b30147ca7f7e7c68
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 <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/ir_builder.cpp
src/glsl/ir_builder.h