diff options
author | Kenneth Graunke <[email protected]> | 2019-07-09 00:32:42 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-07-10 22:14:36 -0700 |
commit | ce93bf18767921dbcba4be0039d912e2fe7b276d (patch) | |
tree | 7331d7a5c1fb99eb6b4df7d00b5f7de9fee2b249 /src/mesa/main/context.c | |
parent | ae4ccb67be29b9bca5c3ba8e5ed175901e1645b6 (diff) |
compiler: Save a single copy of the softfp64 shader in the context.
We were recompiling the softfp64 library of functions from GLSL to NIR
every time we compiled a shader that used fp64. Worse, we were ralloc
stealing it to the GL context. This meant that we'd accumulate lots of
copies for the lifetime of the context, which was a big space leak.
Instead, we can simply stash a single copy in the GL context, and use
it for subsequent compiles. Having a single copy should be fine from
a memory context point of view: nir_inline_function_impl already clones
the necessary nir_function_impl's as it inlines.
KHR-GL45.enhanced_layouts.ssb_member_align_non_power_of_2 was previously
OOM'ing a system with 16GB of RAM when using softfp64. Now it finishes
much more quickly and uses only ~200MB of RAM.
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 2734693b117..42fb404b50e 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1397,6 +1397,8 @@ _mesa_free_context_data(struct gl_context *ctx, bool destroy_compiler_types) if (destroy_compiler_types) _mesa_destroy_shader_compiler_types(); + ralloc_free(ctx->SoftFP64); + /* unbind the context if it's currently bound */ if (ctx == _mesa_get_current_context()) { _mesa_make_current(NULL, NULL, NULL); |