aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-08-07 10:05:38 -0700
committerEric Anholt <[email protected]>2012-08-12 19:08:25 -0700
commit006c1a3c652803e2ff8d5f7ea55c9cb5d8353279 (patch)
tree5e9cca2fc9d3f45780fb65d65faf76c5fee9e0aa /src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
parent97a5f0ff2eb3a6e8b303ce402a4e1d9be7e7b323 (diff)
i965: Add perf debug for stalls during shader compiles.
v2: fix bad comment from before I gave up and decided to just use doubles. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_emit.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_emit.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
index aea7d015a0e..d7ff8de3486 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
@@ -1023,9 +1023,19 @@ extern "C" {
bool
brw_vs_emit(struct gl_shader_program *prog, struct brw_vs_compile *c)
{
+ struct intel_context *intel = &c->func.brw->intel;
+ bool start_busy = false;
+ float start_time = 0;
+
if (!prog)
return false;
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ start_busy = (intel->batch.last_bo &&
+ drm_intel_bo_busy(intel->batch.last_bo));
+ start_time = get_time();
+ }
+
struct brw_shader *shader =
(brw_shader *) prog->_LinkedShaders[MESA_SHADER_VERTEX];
if (!shader)
@@ -1037,8 +1047,14 @@ brw_vs_emit(struct gl_shader_program *prog, struct brw_vs_compile *c)
printf("\n\n");
}
- if (shader->compiled_once) {
- perf_debug("Recompiling vertex shader for program %d\n", prog->Name);
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ if (shader->compiled_once) {
+ perf_debug("Recompiling vertex shader for program %d\n", prog->Name);
+ }
+ if (start_busy && !drm_intel_bo_busy(intel->batch.last_bo)) {
+ perf_debug("VS compile took %.03f ms and stalled the GPU\n",
+ (get_time() - start_time) / 1000);
+ }
}
vec4_visitor v(c, prog, shader);