[Mesa-dev] [PATCH 01/17] i965/asm: Explicitly use a nir_instr for IR annotations

Jason Ekstrand jason at jlekstrand.net
Thu Oct 8 17:22:33 PDT 2015


Now that everything goes through NIR, we don't need this to be a void
pointer anymore.
---
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp   |  2 +-
 src/mesa/drivers/dri/i965/brw_vec4_generator.cpp |  2 +-
 src/mesa/drivers/dri/i965/intel_asm_annotation.c | 17 ++---------------
 src/mesa/drivers/dri/i965/intel_asm_annotation.h |  3 +--
 4 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 6f8b75e..93ff5b1 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -2188,7 +2188,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
               100.0f * (before_size - after_size) / before_size);
 
       dump_assembly(p->store, annotation.ann_count, annotation.ann,
-                    p->devinfo, prog);
+                    p->devinfo);
       ralloc_free(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 dcacc90..2a1e415 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -1663,7 +1663,7 @@ vec4_generator::generate_code(const cfg_t *cfg)
               100.0f * (before_size - after_size) / before_size);
 
       dump_assembly(p->store, annotation.ann_count, annotation.ann,
-                    p->devinfo, prog);
+                    p->devinfo);
       ralloc_free(annotation.ann);
    }
 
diff --git a/src/mesa/drivers/dri/i965/intel_asm_annotation.c b/src/mesa/drivers/dri/i965/intel_asm_annotation.c
index bb8bb8d..b3d6324 100644
--- a/src/mesa/drivers/dri/i965/intel_asm_annotation.c
+++ b/src/mesa/drivers/dri/i965/intel_asm_annotation.c
@@ -33,8 +33,7 @@
 
 void
 dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
-              const struct brw_device_info *devinfo,
-              const struct gl_program *prog)
+              const struct brw_device_info *devinfo)
 {
    const char *last_annotation_string = NULL;
    const void *last_annotation_ir = NULL;
@@ -57,19 +56,7 @@ dump_assembly(void *assembly, int num_annotations, struct annotation *annotation
          last_annotation_ir = annotation[i].ir;
          if (last_annotation_ir) {
             fprintf(stderr, "   ");
-            if (prog->nir)
-               nir_print_instr(annotation[i].ir, stderr);
-            else if (!prog->Instructions)
-               fprint_ir(stderr, annotation[i].ir);
-            else {
-               const struct prog_instruction *pi =
-                  (const struct prog_instruction *)annotation[i].ir;
-               fprintf(stderr, "%d: ",
-                       (int)(pi - prog->Instructions));
-               _mesa_fprint_instruction_opt(stderr,
-                                            pi,
-                                            0, PROG_PRINT_DEBUG, NULL);
-            }
+            nir_print_instr(annotation[i].ir, stderr);
             fprintf(stderr, "\n");
          }
       }
diff --git a/src/mesa/drivers/dri/i965/intel_asm_annotation.h b/src/mesa/drivers/dri/i965/intel_asm_annotation.h
index d9c69bc..6c72326 100644
--- a/src/mesa/drivers/dri/i965/intel_asm_annotation.h
+++ b/src/mesa/drivers/dri/i965/intel_asm_annotation.h
@@ -60,8 +60,7 @@ struct annotation_info {
 
 void
 dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
-              const struct brw_device_info *devinfo,
-              const struct gl_program *prog);
+              const struct brw_device_info *devinfo);
 
 void
 annotate(const struct brw_device_info *devinfo,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list