Mesa (master): i965: Disable emitting if () statements on gen6 until we really fix them.

Eric Anholt anholt at kemper.freedesktop.org
Thu Oct 7 23:42:46 UTC 2010


Module: Mesa
Branch: master
Commit: 4d202da7a4951eb534f77014238e7cdca9f781e9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4d202da7a4951eb534f77014238e7cdca9f781e9

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Oct  7 09:13:09 2010 -0700

i965: Disable emitting if () statements on gen6 until we really fix them.

---

 src/mesa/drivers/dri/i965/brw_context.c |    3 +++
 src/mesa/drivers/dri/i965/brw_fs.cpp    |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 4b44e2a..fa82dfd 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -122,6 +122,9 @@ GLboolean brwCreateContext( int api,
 	 (i == MESA_SHADER_FRAGMENT);
       ctx->ShaderCompilerOptions[i].EmitNoIndirectTemp =
 	 (i == MESA_SHADER_FRAGMENT);
+
+      if (intel->gen == 6)
+	 ctx->ShaderCompilerOptions[i].EmitNoIfs = GL_TRUE;
    }
 
    ctx->Const.VertexProgram.MaxNativeInstructions = (16 * 1024);
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index b93c27e..0b342c2 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -118,6 +118,7 @@ brw_compile_shader(GLcontext *ctx, struct gl_shader *shader)
 GLboolean
 brw_link_shader(GLcontext *ctx, struct gl_shader_program *prog)
 {
+   struct intel_context *intel = intel_context(ctx);
    if (using_new_fs == -1)
       using_new_fs = getenv("INTEL_NEW_FS") != NULL;
 
@@ -162,6 +163,9 @@ brw_link_shader(GLcontext *ctx, struct gl_shader_program *prog)
 						   GL_TRUE, /* temp */
 						   GL_TRUE /* uniform */
 						   ) || progress;
+	    if (intel->gen == 6) {
+	       progress = do_if_to_cond_assign(shader->ir) || progress;
+	    }
 	 } while (progress);
 
 	 validate_ir_tree(shader->ir);




More information about the mesa-commit mailing list