zink: store nir as serialized on zink_shader structs
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 28 Mar 2023 22:52:31 +0000 (18:52 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 4 Apr 2023 01:37:41 +0000 (01:37 +0000)
commitfd2714b5a987c60193cea0514f908a343e57a554
tree1f4fb617eaa054706c5a817cd1eaa800f495cb45
parente40134aea85f3ccdc501b8903d6fe636a1488097
zink: store nir as serialized on zink_shader structs

nir_shader objects are hefty, and they really add up when there's a lot
of them. there's also not much use in keeping them around, as any time
they'll be used, they're always cloned first, and deserializing isn't
likely to be any slower than a clone

cuts driver memory usage by ~40% for tomb raider

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
src/gallium/drivers/zink/zink_compiler.c
src/gallium/drivers/zink/zink_compiler.h
src/gallium/drivers/zink/zink_program.c
src/gallium/drivers/zink/zink_types.h