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

Author: Eric Anholt <e...@anholt.net>
Date:   Fri Mar 11 14:50:17 2011 -0800

i965: Do our lowering passes before the loop of optimization.

The optimization loop won't reinsert noise instructions or quadop
vectors, so we were traversing the tree for nothing.  Lowering vector
indexing was in the loop after do_common_optimization() to avoid the
work if it ended up that the index was actually constant, but that has
been called already in the core.

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 24a3d37..7329f30 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -120,6 +120,14 @@ brw_link_shader(struct gl_context *ctx, struct 
gl_shader_program *prog)
       do_lower_texture_projection(shader->ir);
       do_vec_index_to_cond_assign(shader->ir);
       brw_do_cubemap_normalize(shader->ir);
+      lower_noise(shader->ir);
+      lower_quadop_vector(shader->ir, false);
+      lower_variable_index_to_cond_assign(shader->ir,
+                                         GL_TRUE, /* input */
+                                         GL_TRUE, /* output */
+                                         GL_TRUE, /* temp */
+                                         GL_TRUE /* uniform */
+                                         );
 
       do {
         progress = false;
@@ -134,16 +142,6 @@ brw_link_shader(struct gl_context *ctx, struct 
gl_shader_program *prog)
                                   ) || 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;
-        progress = lower_quadop_vector(shader->ir, false) || progress;
       } while (progress);
 
       validate_ir_tree(shader->ir);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to