nir: Fix printing of individual instructions with io semantics.
authorEric Anholt <eric@anholt.net>
Thu, 27 Aug 2020 18:33:31 +0000 (11:33 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 31 Aug 2020 17:20:43 +0000 (17:20 +0000)
commita3a8322dcd7aaede8dedff131c7d73bdbe3f06f9
treed19588e9de9daffdf965ca5eede8589c9c8dccf2
parent4c050f222fd4a330413bc24fae447782b35df3fe
nir: Fix printing of individual instructions with io semantics.

The state->shader is missing when used outside of nir_print_shader, just
drop these details in that case.  We can fix nir_print_instr() to look up
the shader, but let's also make sure that an instr detached from a shader
(such as one you're constructing but haven't yet inserted) still works.

Fixes: 2b1ef5df4eac ("nir: print IO semantics (v2)")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6496>
src/compiler/nir/nir_print.c