i965: Move program header printing to end of generate_code().
authorMatt Turner <mattst88@gmail.com>
Sun, 25 May 2014 17:46:55 +0000 (10:46 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 2 Jun 2014 22:17:29 +0000 (15:17 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp

index 4ca70392903f42fbda8abeaab95ba48808c8b528..2602b5669ec24ccb61b3ccfb095e425226b37511 100644 (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,
index c62de999027645920e379230c478724cb5145d5e..9ee688cab19511a2acd99d3a0d44a8c400c9e295 100644 (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);
index 51ce4a757829cfd45e6c1162972a67c5c7a36cae..3703368e5f51bf1980c04f62f58d67894865b957 100644 (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);
index 590c75447e5d086e880a12f6485f728988a18aec..c319ed5c099a7e76aa716a2728dae3997a81d5bc 100644 (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);