summaryrefslogtreecommitdiff
path: root/src/glsl/linker.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-08-09 21:22:17 -0700
committerEric Anholt <eric@anholt.net>2010-08-09 21:41:14 -0700
commit5854d4583c6e8885185e12a0636f77489a62e24c (patch)
tree38a132c8c1d5a1f09fc4733da1584fe5dbdd47a3 /src/glsl/linker.cpp
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/glsl/linker.cpp')
-rw-r--r--src/glsl/linker.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 52c9322788..c462d31ef3 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1284,6 +1284,7 @@ link_shaders(struct gl_shader_program *prog)
do_mod_to_fract(ir);
do_div_to_mul_rcp(ir);
do_explog_to_explog2(ir);
+ do_sub_to_add_neg(ir);
do {
progress = false;