diff options
author | Matt Turner <[email protected]> | 2014-05-25 10:46:55 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-06-02 15:17:29 -0700 |
commit | 6fdfe3f2dc4975a002dd019d1f16ff287d5aadfd (patch) | |
tree | 286910b82e3fb7b650ac8010e2ad49f9c02f64e4 | |
parent | 92b055625da1b8d9144bf746ac67210df7deba73 (diff) |
i965: Move program header printing to end of generate_code().
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 30 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen8_fs_generator.cpp | 30 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp | 18 |
4 files changed, 44 insertions, 52 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index 4ca70392903..2602b5669ec 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -1324,22 +1324,6 @@ fs_generator::generate_untyped_surface_read(fs_inst *inst, struct brw_reg dst, void fs_generator::generate_code(exec_list *instructions) { - if (unlikely(debug_flag)) { - if (prog) { - fprintf(stderr, - "Native code for %s fragment shader %d (SIMD%d dispatch):\n", - prog->Label ? prog->Label : "unnamed", - prog->Name, dispatch_width); - } else if (fp) { - fprintf(stderr, - "Native code for fragment program %d (SIMD%d dispatch):\n", - fp->Base.Id, dispatch_width); - } else { - fprintf(stderr, "Native code for blorp program (SIMD%d dispatch):\n", - dispatch_width); - } - } - int start_offset = p->next_insn_offset; struct annotation_info annotation; @@ -1789,6 +1773,20 @@ fs_generator::generate_code(exec_list *instructions) annotation.ann); if (unlikely(debug_flag)) { + if (prog) { + fprintf(stderr, + "Native code for %s fragment shader %d (SIMD%d dispatch):\n", + prog->Label ? prog->Label : "unnamed", + prog->Name, dispatch_width); + } else if (fp) { + fprintf(stderr, + "Native code for fragment program %d (SIMD%d dispatch):\n", + fp->Base.Id, dispatch_width); + } else { + fprintf(stderr, "Native code for blorp program (SIMD%d dispatch):\n", + dispatch_width); + } + const struct gl_program *prog = fp ? &fp->Base : NULL; dump_assembly(p->store, annotation.ann_count, annotation.ann, diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp index c62de999027..9ee688cab19 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp @@ -1263,16 +1263,6 @@ vec4_generator::generate_vec4_instruction(vec4_instruction *instruction, void vec4_generator::generate_code(exec_list *instructions) { - if (unlikely(debug_flag)) { - if (shader_prog) { - fprintf(stderr, "Native code for %s vertex shader %d:\n", - shader_prog->Label ? shader_prog->Label : "unnamed", - shader_prog->Name); - } else { - fprintf(stderr, "Native code for vertex program %d:\n", prog->Id); - } - } - struct annotation_info annotation; memset(&annotation, 0, sizeof(annotation)); @@ -1324,6 +1314,14 @@ vec4_generator::generate_code(exec_list *instructions) brw_compact_instructions(p, 0, annotation.ann_count, annotation.ann); if (unlikely(debug_flag)) { + if (shader_prog) { + fprintf(stderr, "Native code for %s vertex shader %d:\n", + shader_prog->Label ? shader_prog->Label : "unnamed", + shader_prog->Name); + } else { + fprintf(stderr, "Native code for vertex program %d:\n", prog->Id); + } + dump_assembly(p->store, annotation.ann_count, annotation.ann, brw, prog, brw_disassemble); ralloc_free(annotation.ann); diff --git a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp index 51ce4a75782..3703368e5f5 100644 --- a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp @@ -886,22 +886,6 @@ gen8_fs_generator::generate_untyped_surface_read(fs_inst *ir, void gen8_fs_generator::generate_code(exec_list *instructions) { - if (unlikely(INTEL_DEBUG & DEBUG_WM)) { - if (prog) { - fprintf(stderr, - "Native code for %s fragment shader %d (SIMD%d dispatch):\n", - shader_prog->Label ? shader_prog->Label : "unnamed", - shader_prog->Name, dispatch_width); - } else if (fp) { - fprintf(stderr, - "Native code for fragment program %d (SIMD%d dispatch):\n", - prog->Id, dispatch_width); - } else { - fprintf(stderr, "Native code for blorp program (SIMD%d dispatch):\n", - dispatch_width); - } - } - struct annotation_info annotation; memset(&annotation, 0, sizeof(annotation)); @@ -1267,6 +1251,20 @@ gen8_fs_generator::generate_code(exec_list *instructions) annotation_finalize(&annotation, next_inst_offset); if (unlikely(INTEL_DEBUG & DEBUG_WM)) { + if (prog) { + fprintf(stderr, + "Native code for %s fragment shader %d (SIMD%d dispatch):\n", + shader_prog->Label ? shader_prog->Label : "unnamed", + shader_prog->Name, dispatch_width); + } else if (fp) { + fprintf(stderr, + "Native code for fragment program %d (SIMD%d dispatch):\n", + prog->Id, dispatch_width); + } else { + fprintf(stderr, "Native code for blorp program (SIMD%d dispatch):\n", + dispatch_width); + } + dump_assembly(store, annotation.ann_count, annotation.ann, brw, prog, gen8_disassemble); ralloc_free(annotation.ann); diff --git a/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp b/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp index 590c75447e5..c319ed5c099 100644 --- a/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp +++ b/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp @@ -844,16 +844,6 @@ gen8_vec4_generator::generate_vec4_instruction(vec4_instruction *instruction, void gen8_vec4_generator::generate_code(exec_list *instructions) { - if (unlikely(debug_flag)) { - if (shader_prog) { - fprintf(stderr, "Native code for %s vertex shader %d:\n", - shader_prog->Label ? shader_prog->Label : "unnamed", - shader_prog->Name); - } else { - fprintf(stderr, "Native code for vertex program %d:\n", prog->Id); - } - } - struct annotation_info annotation; memset(&annotation, 0, sizeof(annotation)); @@ -897,6 +887,14 @@ gen8_vec4_generator::generate_code(exec_list *instructions) annotation_finalize(&annotation, next_inst_offset); if (unlikely(debug_flag)) { + if (shader_prog) { + fprintf(stderr, "Native code for %s vertex shader %d:\n", + shader_prog->Label ? shader_prog->Label : "unnamed", + shader_prog->Name); + } else { + fprintf(stderr, "Native code for vertex program %d:\n", prog->Id); + } + dump_assembly(store, annotation.ann_count, annotation.ann, brw, prog, gen8_disassemble); ralloc_free(annotation.ann); |