[Mesa-dev] [PATCH 2/2] i965: Delete linked GLSL IR when using NIR.

Kenneth Graunke kenneth at whitecape.org
Thu Jun 11 01:42:41 PDT 2015


On Thursday, June 11, 2015 10:41:53 AM Tapani Pälli 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.
> 
> 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);
>     }
> 

Thanks, Tapani!

Both are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

I also think they might be worth a
Cc: mesa-stable at lists.freedesktop.org
since it saves a pretty large amount of memory.  I'm happy to concede on
that point if others feel differently, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150611/6c667bb0/attachment.sig>


More information about the mesa-dev mailing list