[Mesa-dev] [PATCH 2/2] i965: Delete linked GLSL IR when using NIR.
Jason Ekstrand
jason at jlekstrand.net
Thu Jun 11 09:40:19 PDT 2015
On Thu, Jun 11, 2015 at 12:41 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> This is based on Kenneth's patch to delete 'most of the IR'. Due to
> linker changes to clone variables, we can now free all of IR.
>
> Saves 58MB of memory when replaying a Dota 2 trace on Broadwell.
I think we've saved ~50 MB 3 times now on that one dota trace. Good work guys!
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
> src/mesa/drivers/dri/i965/brw_shader.cpp | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index 76285f2..99de1cd 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -297,8 +297,11 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
>
> brw_add_texrect_params(prog);
>
> - if (options->NirOptions)
> + if (options->NirOptions) {
> prog->nir = brw_create_nir(brw, shProg, prog, (gl_shader_stage) stage);
> + ralloc_free(shader->ir);
> + shader->ir = NULL;
> + }
>
> _mesa_reference_program(ctx, &prog, NULL);
> }
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list