diff options
author | Matt Turner <mattst88@gmail.com> | 2014-03-02 10:34:45 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2014-03-18 23:20:29 -0700 |
commit | c049dd4396d1639859810d6124faa863dae61d1b (patch) | |
tree | 047633ec813c5f55e9f2e56397e1d0e932d2edca /src/glsl/ir_builder.cpp | |
parent | 6cbc64c3cb416fadad6e80042e24cd1e1b682897 (diff) |
glsl: Allow dot() on scalars, and throw out dotlike().
In all uses of dotlike() we're writing generic code that operates on 1-4
component vectors. That our IR requires ir_binop_dot expressions'
operands to be 2+ component vectors is an implementation detail that's
not important when implementing built-in functions with dot(), which is
defined for scalar floats in GLSL.
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/glsl/ir_builder.cpp')
-rw-r--r-- | src/glsl/ir_builder.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index 7f41ed69ef..f4a1c6efa0 100644 --- a/src/glsl/ir_builder.cpp +++ b/src/glsl/ir_builder.cpp @@ -251,13 +251,8 @@ ir_expression *round_even(operand a) return expr(ir_unop_round_even, a); } -ir_expression *dot(operand a, operand b) -{ - return expr(ir_binop_dot, a, b); -} - /* dot for vectors, mul for scalars */ -ir_expression *dotlike(operand a, operand b) +ir_expression *dot(operand a, operand b) { assert(a.val->type == b.val->type); |