Module: Mesa
Branch: master
Commit: 5e5604cc28a9542d3f21f63b1c3e04f7650dc0d6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e5604cc28a9542d3f21f63b1c3e04f7650dc0d6

Author: Rob Clark <[email protected]>
Date:   Mon Sep  1 12:36:34 2014 -0400

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 <[email protected]>

---

 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 ddf99db..04de532 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

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to