i965: Delete linked GLSL IR when using NIR.

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@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
This commit is contained in:
Tapani Pälli 2015-06-11 10:41:53 +03:00 committed by Kenneth Graunke
parent c2ff3485b3
commit 104c8fc2c2
1 changed files with 4 additions and 1 deletions

View File

@ -387,8 +387,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);
}