mesa: Don't flatten IF statements by default.

MaxIfDepth of 0 means "flatten all the time", not "never flatten".
This is only desirable on hardware that can't support control flow;
software rasterization and most hardware drivers want this.

This alters behavior for swrast as well as i915.  Tested on i915.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Kenneth Graunke
2012-09-20 14:27:29 -07:00
parent b2e0293213
commit 56705cd36b

View File

@@ -105,6 +105,7 @@ _mesa_init_shader_state(struct gl_context *ctx)
memset(&options, 0, sizeof(options)); memset(&options, 0, sizeof(options));
options.MaxUnrollIterations = 32; options.MaxUnrollIterations = 32;
options.MaxIfDepth = UINT_MAX;
/* Default pragma settings */ /* Default pragma settings */
options.DefaultPragmas.Optimize = GL_TRUE; options.DefaultPragmas.Optimize = GL_TRUE;