From 5e5604cc28a9542d3f21f63b1c3e04f7650dc0d6 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 1 Sep 2014 12:36:34 -0400 Subject: [PATCH] freedreno/ir3: don't keep IR around Once we've assembled the shader, no need to keep the intermediate around. Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3_shader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.c b/src/gallium/drivers/freedreno/ir3/ir3_shader.c index ddf99dbc46e..04de532f499 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.c @@ -45,7 +45,8 @@ static void delete_variant(struct ir3_shader_variant *v) { - ir3_destroy(v->ir); + if (v->ir) + ir3_destroy(v->ir); fd_bo_del(v->bo); free(v); } @@ -69,6 +70,10 @@ assemble_variant(struct ir3_shader_variant *v) v->instrlen = v->info.sizedwords / 8; v->constlen = v->info.max_const + 1; + + /* no need to keep the ir around beyond this point: */ + ir3_destroy(v->ir); + v->ir = NULL; } /* for vertex shader, the inputs are loaded into registers before the shader -- 2.30.2