summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_algebraic.cpp
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-10-30 15:39:36 -0700
committerMatt Turner <[email protected]>2014-11-03 11:27:50 -0800
commit5fbcb1b41d370b0ba23d2151b690a225b75fb3a0 (patch)
tree3edeb9522f41c1561cd5f5f070a983d8418eb3a7 /src/glsl/opt_algebraic.cpp
parent336e76c1439823185d425ebecb849ce38d55c4eb (diff)
glsl: Remove now useless dot optimization on basis vect
The optimization in commit d056863b covers these cases, which were the first optimizations I added to the GLSL compiler. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/opt_algebraic.cpp')
-rw-r--r--src/glsl/opt_algebraic.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp
index a2d7e4919c4..430f5cb9790 100644
--- a/src/glsl/opt_algebraic.cpp
+++ b/src/glsl/opt_algebraic.cpp
@@ -105,12 +105,6 @@ is_vec_negative_one(ir_constant *ir)
}
static inline bool
-is_vec_basis(ir_constant *ir)
-{
- return (ir == NULL) ? false : ir->is_basis();
-}
-
-static inline bool
is_valid_vec_const(ir_constant *ir)
{
if (ir == NULL)
@@ -537,23 +531,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1]))
return ir_constant::zero(mem_ctx, ir->type);
- if (is_vec_basis(op_const[0])) {
- unsigned component = 0;
- for (unsigned c = 0; c < op_const[0]->type->vector_elements; c++) {
- if (op_const[0]->value.f[c] == 1.0)
- component = c;
- }
- return new(mem_ctx) ir_swizzle(ir->operands[1], component, 0, 0, 0, 1);
- }
- if (is_vec_basis(op_const[1])) {
- unsigned component = 0;
- for (unsigned c = 0; c < op_const[1]->type->vector_elements; c++) {
- if (op_const[1]->value.f[c] == 1.0)
- component = c;
- }
- return new(mem_ctx) ir_swizzle(ir->operands[0], component, 0, 0, 0, 1);
- }
-
for (int i = 0; i < 2; i++) {
if (!op_const[i])
continue;