gallium/draw: Free specialized versions of driver shaders
authorKeith Whitwell <keithw@vmware.com>
Tue, 2 Jun 2009 03:16:20 +0000 (20:16 -0700)
committerKeith Whitwell <keithw@vmware.com>
Tue, 2 Jun 2009 03:35:38 +0000 (20:35 -0700)
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
src/gallium/auxiliary/draw/draw_pipe_aapoint.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c

index 0d322b0aab701a097ea160e9eb1b4f4288eec55d..9f956715a228135df0459358ef0ff8242cf789e3 100644 (file)
@@ -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);
 }
 
index 729cf75e65968555d38f0e9e1761ba9f2cf0ed15..ae1712fe122a901bcfafda05c98d32b927299c28 100644 (file)
@@ -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);
 }
 
index bc63b700dea9817df6fc0b832a71359a5c89ea80..30a6d2919d96441c2d16e3ff851c886f8db20564 100644 (file)
@@ -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);
 }