[Mesa-dev] [PATCH 4/6] i965: Include codegen time in the INTEL_DEBUG=perf stall detection.
Eric Anholt
eric at anholt.net
Fri Nov 30 13:24:18 PST 2012
In the VS case, we were missing the entire compile time in the stall
detection!
---
src/mesa/drivers/dri/i965/brw_fs.cpp | 9 ++++++---
src/mesa/drivers/dri/i965/brw_vec4.cpp | 21 ++++++++++++---------
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 b777172..e143e7a 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 1a199d6..5200daa 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" */
--
1.7.10.4
More information about the mesa-dev
mailing list