summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-04-07 15:18:37 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-07 17:23:23 -0700
commit6173312d84daabaf6dbe8fa15558cba4c9cb9f5e (patch)
treeb8653d3f7d73e2457d058b964ed4385c5c563b68
parent7e78e07ddb8a1e2abd3786aeb4740addd301d67c (diff)
Make dot() take the right number of args.
-rw-r--r--builtin_function.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/builtin_function.cpp b/builtin_function.cpp
index ec6fd1b..9cefbd4 100644
--- a/builtin_function.cpp
+++ b/builtin_function.cpp
@@ -311,12 +311,13 @@ generate_dot(exec_list *instructions,
ir_variable **declarations,
const glsl_type *type)
{
- ir_dereference *const arg = new ir_dereference(declarations[0]);
+ ir_dereference *const arg0 = new ir_dereference(declarations[0]);
+ ir_dereference *const arg1 = new ir_dereference(declarations[1]);
ir_rvalue *result;
(void)type;
- result = new ir_expression(ir_binop_dot, glsl_type::float_type, arg, arg);
+ result = new ir_expression(ir_binop_dot, glsl_type::float_type, arg0, arg1);
ir_instruction *inst = new ir_return(result);
instructions->push_tail(inst);
@@ -335,13 +336,13 @@ generate_dot_functions(glsl_symbol_table *symtab, exec_list *instructions)
bool added = symtab->add_function(name, f);
assert(added);
- generate_function_instance(f, name, instructions, 1, generate_dot,
+ generate_function_instance(f, name, instructions, 2, generate_dot,
float_type, float_type);
- generate_function_instance(f, name, instructions, 1, generate_dot,
+ generate_function_instance(f, name, instructions, 2, generate_dot,
float_type, vec2_type);
- generate_function_instance(f, name, instructions, 1, generate_dot,
+ generate_function_instance(f, name, instructions, 2, generate_dot,
float_type, vec3_type);
- generate_function_instance(f, name, instructions, 1, generate_dot,
+ generate_function_instance(f, name, instructions, 2, generate_dot,
float_type, vec4_type);
}