Mesa (master): i965: Apply the same set of lowering passes to new FS as to Mesa IR.

Eric Anholt anholt at kemper.freedesktop.org
Tue Sep 28 16:38:03 UTC 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Sep 27 21:35:54 2010 -0700

i965: Apply the same set of lowering passes to new FS as to Mesa IR.

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 |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index c324be2..31f5bbf 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -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);




More information about the mesa-commit mailing list