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 <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6496>
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);
}