summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_algebraic.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-10-30 15:39:36 -0700
committerMatt Turner <mattst88@gmail.com>2014-11-03 11:27:50 -0800
commit5fbcb1b41d370b0ba23d2151b690a225b75fb3a0 (patch)
tree3edeb9522f41c1561cd5f5f070a983d8418eb3a7 /src/glsl/opt_algebraic.cpp
parent336e76c1439823185d425ebecb849ce38d55c4eb (diff)
downloadexternal_mesa3d-5fbcb1b41d370b0ba23d2151b690a225b75fb3a0.zip
external_mesa3d-5fbcb1b41d370b0ba23d2151b690a225b75fb3a0.tar.gz
external_mesa3d-5fbcb1b41d370b0ba23d2151b690a225b75fb3a0.tar.bz2
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 <ian.d.romanick@intel.com>
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 a2d7e49..430f5cb 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;