diff options
author | Bryan Cain <bryancain3@gmail.com> | 2011-08-31 17:28:53 -0500 |
---|---|---|
committer | Bryan Cain <bryancain3@gmail.com> | 2011-08-31 21:49:26 -0500 |
commit | 488fe51cf823ccd137c667f1e92dd86f8323b723 (patch) | |
tree | 498eaba0b4e1e0de46ef932417d9e6b6e8165c20 /src/mesa/program | |
parent | 7b1d94e5d1f53ac5f59000176aea1d02fc9a1181 (diff) |
mesa: Replace the EmitNoIfs compiler flag with a MaxIfDepth flag.
This is a better, more fine-grained way of lowering if statements. Fixes the
game And Yet It Moves on nv50.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index dd154db8b03..9813c4ae8a5 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -3119,7 +3119,7 @@ get_mesa_program(struct gl_context *ctx, switch (mesa_inst->Opcode) { case OPCODE_IF: - if (options->EmitNoIfs) { + if (options->MaxIfDepth == 0) { linker_warning(shader_program, "Couldn't flatten if-statement. " "This will likely result in software " @@ -3241,10 +3241,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->MaxIfDepth == 0) progress = lower_discard(ir) || progress; - progress = lower_if_to_cond_assign(ir) || progress; - } + + progress = lower_if_to_cond_assign(ir, options->MaxIfDepth) || progress; if (options->EmitNoNoise) progress = lower_noise(ir) || progress; |