i965: Move program header printing to end of generate_code().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Matt Turner 2014-05-25 10:46:55 -07:00
parent 92b055625d
commit 6fdfe3f2dc
4 changed files with 44 additions and 52 deletions

View file

@ -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,

View file

@ -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);

View file

@ -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);

View file

@ -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);