nir: Look up the shader when printing a single instruction.
[mesa.git] / src / compiler / nir / nir_print.c
index 6e871b6c9506ff968d454966b406dbfaafa6f41e..c5a8efd1ec51753ae95b957f56f9458196f12db5 100644 (file)
@@ -1586,6 +1586,11 @@ nir_print_instr(const nir_instr *instr, FILE *fp)
    print_state state = {
       .fp = fp,
    };
+   if (instr->block) {
+      nir_function_impl *impl = nir_cf_node_get_function(&instr->block->cf_node);
+      state.shader = impl->function->shader;
+   }
+
    print_instr(instr, &state, 0);
 
 }