void nir_print_shader(nir_shader *shader, FILE *fp);
void nir_print_shader_annotated(nir_shader *shader, FILE *fp, struct hash_table *errors);
void nir_print_instr(const nir_instr *instr, FILE *fp);
+void nir_print_deref(const nir_deref_instr *deref, FILE *fp);
nir_shader *nir_shader_clone(void *mem_ctx, const nir_shader *s);
nir_function_impl *nir_function_impl_clone(const nir_function_impl *fi);
fprintf(fp, "ssa_%u", def->index);
}
-static void print_src(nir_src *src, print_state *state);
+static void print_src(const nir_src *src, print_state *state);
static void
-print_reg_src(nir_reg_src *src, print_state *state)
+print_reg_src(const nir_reg_src *src, print_state *state)
{
FILE *fp = state->fp;
print_register(src->reg, state);
}
static void
-print_src(nir_src *src, print_state *state)
+print_src(const nir_src *src, print_state *state)
{
if (src->is_ssa)
print_ssa_use(src->ssa, state);
}
static void
-print_deref_link(nir_deref_instr *instr, bool whole_chain, print_state *state)
+print_deref_link(const nir_deref_instr *instr, bool whole_chain, print_state *state)
{
FILE *fp = state->fp;
print_instr(instr, &state, 0);
}
+
+void
+nir_print_deref(const nir_deref_instr *deref, FILE *fp)
+{
+ print_state state = {
+ .fp = fp,
+ };
+ print_deref_link(deref, true, &state);
+}