summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-09 21:22:17 -0700
committerEric Anholt <[email protected]>2010-08-09 21:41:14 -0700
commit5854d4583c6e8885185e12a0636f77489a62e24c (patch)
tree38a132c8c1d5a1f09fc4733da1584fe5dbdd47a3 /src/mesa/program
parent8bebbeb7c5b26ec9166a4644a2c051238d18509b (diff)
glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))
All the current HW backends transform subtract to adding the negation, so I haven't bothered peepholing it back out in Mesa IR. This allows some subtract of subtract to get removed in ir_algebraic.
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 5a272ab88a1..a9a6f977c01 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2570,6 +2570,7 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
do_mat_op_to_vec(shader->ir);
do_mod_to_fract(shader->ir);
do_div_to_mul_rcp(shader->ir);
+ do_sub_to_add_neg(shader->ir);
/* Optimization passes */
bool progress;