asahi: Serialize NIR in memory
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 29 Jun 2023 00:24:40 +0000 (20:24 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 20 Jul 2023 15:33:27 +0000 (15:33 +0000)
commit198c51d66495197e12ce3fad36e9e1c6dc8d9be4
tree1722becf02d03373488e9f44133af9df33a43927
parent8df0a86cc09d1f0b4521096edcc37fe505fa21d6
asahi: Serialize NIR in memory

Deserializing isn't expected to be much more expensive than cloning, and the
serialized NIR is *significantly* smaller. So store the serialized instead of
the deserialized, and deserialize on the fly.

This reduces a lot of noise in valgrind due to random crap alloc'd against the
NIR shader by lowering passes that now get properly freed.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
src/gallium/drivers/asahi/agx_disk_cache.c
src/gallium/drivers/asahi/agx_state.c
src/gallium/drivers/asahi/agx_state.h