summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBryan Cain <[email protected]>2011-08-31 17:28:53 -0500
committerBryan Cain <[email protected]>2011-08-31 21:49:26 -0500
commit488fe51cf823ccd137c667f1e92dd86f8323b723 (patch)
tree498eaba0b4e1e0de46ef932417d9e6b6e8165c20 /src/mesa/state_tracker
parent7b1d94e5d1f53ac5f59000176aea1d02fc9a1181 (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 <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_extensions.c2
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 8e900934054..322dbbfd51d 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -173,7 +173,7 @@ void st_init_limits(struct st_context *st)
options->EmitNoNoise = TRUE;
/* TODO: make these more fine-grained if anyone needs it */
- options->EmitNoIfs = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
+ options->MaxIfDepth = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
options->EmitNoLoops = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
options->EmitNoFunctions = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES);
options->EmitNoMainReturn = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES);
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 98bea69b959..e2857edf390 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4991,10 +4991,10 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
progress = lower_quadop_vector(ir, false) || 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;