freedreno/ir3: don't keep IR around
authorRob Clark <robclark@freedesktop.org>
Mon, 1 Sep 2014 16:36:34 +0000 (12:36 -0400)
committerRob Clark <robclark@freedesktop.org>
Mon, 1 Sep 2014 22:08:21 +0000 (18:08 -0400)
Once we've assembled the shader, no need to keep the intermediate
around.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3_shader.c

index ddf99dbc46ea079a489fcdd445273b65a677955c..04de532f4998bc26567d8e854b1ddb6b452b88f8 100644 (file)
@@ -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