aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_print.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-11-05 15:10:37 -0800
committerEric Anholt <[email protected]>2015-01-23 17:30:11 -0800
commit0680d170d161f2a370e16e2506cb0bf982a8909d (patch)
treed9b28533912ef5cd68b602e6421b998dfab424ba /src/glsl/nir/nir_print.c
parent6445a405201420698a3f6e292a3b2363fe7ff7f6 (diff)
nir: Expose nir_print_instr() for debug prints
It's nice to have this present in your default cases so you can see what instruction is triggering an abort. v2: Just pass a NULL state, now that it won't crash when you do. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_print.c')
-rw-r--r--src/glsl/nir/nir_print.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
index 2ef55ed36f3..9c07950a67d 100644
--- a/src/glsl/nir/nir_print.c
+++ b/src/glsl/nir/nir_print.c
@@ -621,8 +621,6 @@ print_instr(nir_instr *instr, print_var_state *state, unsigned tabs, FILE *fp)
unreachable("Invalid instruction type");
break;
}
-
- fprintf(fp, "\n");
}
static int
@@ -668,6 +666,7 @@ print_block(nir_block *block, print_var_state *state, unsigned tabs, FILE *fp)
nir_foreach_instr(block, instr) {
print_instr(instr, state, tabs, fp);
+ fprintf(fp, "\n");
}
print_tabs(tabs, fp);
@@ -881,3 +880,9 @@ nir_print_shader(nir_shader *shader, FILE *fp)
destroy_print_state(&state);
}
+
+void
+nir_print_instr(nir_instr *instr, FILE *fp)
+{
+ print_instr(instr, NULL, 0, fp);
+}