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 <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6496>
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user