From b126228f1247fb0fed686ee3ef2c87461f2fc7a7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Nov 2012 12:55:50 -0800 Subject: [PATCH] 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 --- 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 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" */ -- 2.30.2