projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5489ad0
)
ir_constant_expression: Simplify code that implements the "dot" builtin.
author
Kenneth Graunke
<kenneth@whitecape.org>
Thu, 22 Jul 2010 03:12:43 +0000
(20:12 -0700)
committer
Kenneth Graunke
<kenneth@whitecape.org>
Wed, 28 Jul 2010 22:46:28 +0000
(15:46 -0700)
There's no need to use an ir_expression; we have a handy C function.
src/glsl/ir_constant_expression.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ir_constant_expression.cpp
b/src/glsl/ir_constant_expression.cpp
index 83d1b34bed6712fe273e1ce670e05d0d5f31af9c..d20d1953e24bf76906203e3b3c8ef7fc6b8dc113 100644
(file)
--- a/
src/glsl/ir_constant_expression.cpp
+++ b/
src/glsl/ir_constant_expression.cpp
@@
-858,7
+858,7
@@
ir_call::constant_expression_value()
}
return new(mem_ctx) ir_constant(sqrtf(length_squared));
} else if (strcmp(callee, "dot") == 0) {
-
expr = new(mem_ctx) ir_expression(ir_binop_dot, type, op[0], op[1]
);
+
return new(mem_ctx) ir_constant(dot(op[0], op[1])
);
} else if (strcmp(callee, "equal") == 0) {
assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
for (unsigned c = 0; c < op[0]->type->components(); c++) {