summaryrefslogtreecommitdiff
path: root/src/mesa/program
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-11-25 01:09:26 -0800
committerKenneth Graunke <kenneth@whitecape.org>2010-12-01 11:52:43 -0800
commit940df10100d740ef27fa39026fd51c3199ed3d62 (patch)
treee98326e594fb6dc9fcf7feef37e769e08ac61d1e /src/mesa/program
parent9a1d063c6d679c2155f5eb80f1cb94368d36bf2c (diff)
glsl: Add a lowering pass to move discards out of if-statements.
This should allow lower_if_to_cond_assign to work in the presence of discards, fixing bug #31690 and likely #31983. NOTE: This is a candidate for the 7.9 branch.
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 5dd602fd83..d9d86b6c29 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2858,8 +2858,10 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
progress = lower_quadop_vector(ir, true) || progress;
- if (options->EmitNoIfs)
+ if (options->EmitNoIfs) {
+ progress = lower_discard(ir) || progress;
progress = do_if_to_cond_assign(ir) || progress;
+ }
if (options->EmitNoNoise)
progress = lower_noise(ir) || progress;