i965: Complain about variable index lowering when INTEL_DEBUG=perf.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 19 Sep 2012 20:27:59 +0000 (13:27 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 29 Sep 2012 07:36:56 +0000 (00:36 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_shader.cpp

index 1cd9095f2ea1947628f8a2db1154423380d3a61d..f8482e1695c4cce857daeea56e6ed86602a3211d 100644 (file)
@@ -143,8 +143,14 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
       bool temp = stage == MESA_SHADER_FRAGMENT;
       bool uniform = stage == MESA_SHADER_FRAGMENT;
 
-      lower_variable_index_to_cond_assign(shader->ir,
-                                         input, output, temp, uniform);
+      bool lowered_variable_indexing =
+         lower_variable_index_to_cond_assign(shader->ir,
+                                             input, output, temp, uniform);
+
+      if (unlikely((INTEL_DEBUG & DEBUG_PERF) && lowered_variable_indexing)) {
+         perf_debug("Unsupported form of variable indexing in FS; falling "
+                    "back to very inefficient code generation\n");
+      }
 
       /* FINISHME: Do this before the variable index lowering. */
       lower_ubo_reference(&shader->base, shader->ir);