compiler/types: Don't store a mem_ctx per type
authorCaio Oliveira <caio.oliveira@intel.com>
Thu, 31 Aug 2023 18:59:38 +0000 (11:59 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 13 Sep 2023 05:16:58 +0000 (05:16 +0000)
commit8a62b669f20cf7384a0c60fedd3067fe5d52db53
tree8d9aa894b8838f71bba442951dd31abe9eeb565e
parent4f1473ef977c2a5effca03f2e671cfe1b0eb70d0
compiler/types: Don't store a mem_ctx per type

These are used only by types created at runtime.  Since those will follow
the lifetime of the glsl_type_cache, we can use its mem_ctx for all the types.

Without a mem_ctx, there's nothing to be done in the destructor, so remove it.

Note some keys are calculated by building a mock type, so we need to create
a tmp_ctx in some cases.  We'll get rid of them in a later commit.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
src/compiler/glsl_types.cpp
src/compiler/glsl_types.h