i965: Include codegen time in the INTEL_DEBUG=perf stall detection.
authorEric Anholt <eric@anholt.net>
Fri, 30 Nov 2012 20:55:50 +0000 (12:55 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 3 Dec 2012 21:19:50 +0000 (13:19 -0800)
In the VS case, we were missing the entire compile time in the stall
detection!

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

index b777172c239bf259ac9bcd7fb4ea7cbe05e19599..e143e7adbdd23d2abb9131dfb9779889e240b3d9 100644 (file)
@@ -2287,6 +2287,11 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c,
 
    c->prog_data.dispatch_width = 8;
 
+   fs_generator g(brw, c, prog, fp, v.dual_src_output.file != BAD_FILE);
+   const unsigned *generated = g.generate_assembly(&v.instructions,
+                                                   simd16_instructions,
+                                                   final_assembly_size);
+
    if (unlikely(INTEL_DEBUG & DEBUG_PERF) && shader) {
       if (shader->compiled_once)
          brw_wm_debug_recompile(brw, prog, &c->key);
@@ -2298,9 +2303,7 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c,
       }
    }
 
-   fs_generator g(brw, c, prog, fp, v.dual_src_output.file != BAD_FILE);
-   return g.generate_assembly(&v.instructions, simd16_instructions,
-                              final_assembly_size);
+   return generated;
 }
 
 bool
index 1a199d6e822de448e7174b853259a69a006b04c0..5200daac043c3653283dcad8a449066206ad0ec8 100644 (file)
@@ -1159,6 +1159,17 @@ brw_vs_emit(struct brw_context *brw,
       }
    }
 
+   vec4_visitor v(brw, c, prog, shader, mem_ctx);
+   if (!v.run()) {
+      prog->LinkStatus = false;
+      ralloc_strcat(&prog->InfoLog, v.fail_msg);
+      return NULL;
+   }
+
+   vec4_generator g(brw, c, prog, mem_ctx);
+   const unsigned *generated =g.generate_assembly(&v.instructions,
+                                                  final_assembly_size);
+
    if (unlikely(INTEL_DEBUG & DEBUG_PERF) && shader) {
       if (shader->compiled_once) {
          brw_vs_debug_recompile(brw, prog, &c->key);
@@ -1170,15 +1181,7 @@ brw_vs_emit(struct brw_context *brw,
       shader->compiled_once = true;
    }
 
-   vec4_visitor v(brw, c, prog, shader, mem_ctx);
-   if (!v.run()) {
-      prog->LinkStatus = false;
-      ralloc_strcat(&prog->InfoLog, v.fail_msg);
-      return NULL;
-   }
-
-   vec4_generator g(brw, c, prog, mem_ctx);
-   return g.generate_assembly(&v.instructions, final_assembly_size);
+   return generated;
 }
 
 } /* extern "C" */