Mesa (mesa_7_5_branch): gallium/draw: Free specialized versions of driver shaders

Keith Whitwell keithw at kemper.freedesktop.org
Mon Jun 1 20:36:19 PDT 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 1aef032d438aaa40ec28bf279ad5c089370773f0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1aef032d438aaa40ec28bf279ad5c089370773f0

Author: Keith Whitwell <keithw at vmware.com>
Date:   Mon Jun  1 20:16:20 2009 -0700

gallium/draw: Free specialized versions of driver shaders

The pstipple, aaline and aapoint code would create specialized versions
of shaders and upload them to the driver -- but never free them.

---

 src/gallium/auxiliary/draw/draw_pipe_aaline.c   |    4 ++++
 src/gallium/auxiliary/draw/draw_pipe_aapoint.c  |    5 +++++
 src/gallium/auxiliary/draw/draw_pipe_pstipple.c |    4 ++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index 0d322b0..9f95671 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -819,6 +819,10 @@ aaline_delete_fs_state(struct pipe_context *pipe, void *fs)
    struct aaline_fragment_shader *aafs = (struct aaline_fragment_shader *) fs;
    /* pass-through */
    aaline->driver_delete_fs_state(aaline->pipe, aafs->driver_fs);
+
+   if (aafs->aaline_fs)
+      aaline->driver_delete_fs_state(aaline->pipe, aafs->aaline_fs);
+
    FREE(aafs);
 }
 
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
index 729cf75..ae1712f 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
@@ -829,8 +829,13 @@ aapoint_delete_fs_state(struct pipe_context *pipe, void *fs)
 {
    struct aapoint_stage *aapoint = aapoint_stage_from_pipe(pipe);
    struct aapoint_fragment_shader *aafs = (struct aapoint_fragment_shader *) fs;
+
    /* pass-through */
    aapoint->driver_delete_fs_state(aapoint->pipe, aafs->driver_fs);
+
+   if (aafs->aapoint_fs)
+      aapoint->driver_delete_fs_state(aapoint->pipe, aafs->aapoint_fs);
+
    FREE(aafs);
 }
 
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index bc63b70..30a6d29 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -650,6 +650,10 @@ pstip_delete_fs_state(struct pipe_context *pipe, void *fs)
    struct pstip_fragment_shader *aafs = (struct pstip_fragment_shader *) fs;
    /* pass-through */
    pstip->driver_delete_fs_state(pstip->pipe, aafs->driver_fs);
+
+   if (aafs->pstip_fs)
+      pstip->driver_delete_fs_state(pstip->pipe, aafs->pstip_fs);
+
    FREE(aafs);
 }
 



More information about the mesa-commit mailing list