i965/vs: Don't lower uniform array indexing.
authorEric Anholt <eric@anholt.net>
Mon, 22 Aug 2011 18:48:04 +0000 (11:48 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 30 Aug 2011 19:09:40 +0000 (12:09 -0700)
This avoids the massive conditional move array access, and brings code
generation quality for the new VS backend into the realm of efficiency
of the old backend (roughly 20% more instructions generated than
before across shader-db, instead of assertion failing for generating
over 10,000 instructions on many shaders!).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_shader.cpp

index 597c4cd..0a21094 100644 (file)
@@ -119,7 +119,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
       bool input = true;
       bool output = stage == MESA_SHADER_FRAGMENT;
       bool temp = stage == MESA_SHADER_FRAGMENT;
-      bool uniform = true;
+      bool uniform = stage == MESA_SHADER_FRAGMENT;
 
       lower_variable_index_to_cond_assign(shader->ir,
                                          input, output, temp, uniform);