i965: Apply the same set of lowering passes to new FS as to Mesa IR.
authorEric Anholt <eric@anholt.net>
Tue, 28 Sep 2010 04:35:54 +0000 (21:35 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 28 Sep 2010 16:33:30 +0000 (09:33 -0700)
While much of this we will want to support natively, this should make
the task of reaching the Mesa IR backend's quality easier.

Fixes:
glsl-fs-main-return.

src/mesa/drivers/dri/i965/brw_fs.cpp

index c324be210a0f4a16b59e452ad0f785ac843d7b74..31f5bbf58711c542dac95dbd112e21f2147bb662 100644 (file)
@@ -141,7 +141,22 @@ brw_link_shader(GLcontext *ctx, struct gl_shader_program *prog)
         do {
            progress = false;
 
+           progress = do_lower_jumps(shader->ir, true, true,
+                                     true, /* main return */
+                                     false, /* continue */
+                                     false /* loops */
+                                     ) || progress;
+
            progress = do_common_optimization(shader->ir, true, 32) || progress;
+
+           progress = lower_noise(shader->ir) || progress;
+           progress =
+              lower_variable_index_to_cond_assign(shader->ir,
+                                                  GL_TRUE, /* input */
+                                                  GL_TRUE, /* output */
+                                                  GL_TRUE, /* temp */
+                                                  GL_TRUE /* uniform */
+                                                  ) || progress;
         } while (progress);
 
         validate_ir_tree(shader->ir);