From: Eric Anholt Date: Fri, 28 Aug 2020 19:27:04 +0000 (-0700) Subject: nir: Look up the shader when printing a single instruction. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e281ee04dfe3d035f0da4ad37240392ddf41220c;p=mesa.git nir: Look up the shader when printing a single instruction. If you've inserted the instruction into a block, then we can get to the shader. This improves our instruction output, giving you i/o semantics and variable names in intrinsics. Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 6e871b6c950..c5a8efd1ec5 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -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); }