summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-11-30 12:55:50 -0800
committerEric Anholt <[email protected]>2012-12-03 13:19:50 -0800
commitb126228f1247fb0fed686ee3ef2c87461f2fc7a7 (patch)
treec98509d314e9dfb3bde0f95138a0d6ce4b85250b
parent0f06864ba566eaff5b739a9d0fba5ed7eaadd60b (diff)
i965: Include codegen time in the INTEL_DEBUG=perf stall detection.
In the VS case, we were missing the entire compile time in the stall detection! Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp9
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp21
2 files changed, 18 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index b777172c239..e143e7adbdd 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -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
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 1a199d6e822..5200daac043 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -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" */