[Mesa-dev] [PATCH] i915: Don't flatten IF statements in the vertex shader.

Kenneth Graunke kenneth at whitecape.org
Fri Sep 14 23:27:22 PDT 2012


MaxIfDepth of 0 means "flatten all the time", not "never flatten".
Vertex shading is done using swrast, which can handle control flow
just fine.  Giving it less instructions will probably help performance.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i915/i915_context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index fcdc8ff..a925a28 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -271,6 +271,7 @@ i915CreateContext(int api,
     * FINISHME: vertex shaders?
     */
    ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitCondCodes = true;
+   ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].MaxIfDepth = UINT_MAX;
 
    struct gl_shader_compiler_options *const fs_options =
       & ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
-- 
1.7.11.4



More information about the mesa-dev mailing list