draw: Duplicate TGSI tokens in draw_pipe_pstipple module.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 14 Mar 2014 16:57:34 +0000 (16:57 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 25 Mar 2014 12:54:39 +0000 (12:54 +0000)
As done in draw_pipe_aaline and draw_pipe_aapoint modules.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/draw/draw_pipe_pstipple.c

index d7dcfdb596ff9e7aa3b1f1197dc64ffbe6c6a066..d2167879318d59cbd239925580548312f3cea93f 100644 (file)
@@ -673,7 +673,7 @@ pstip_create_fs_state(struct pipe_context *pipe,
    struct pstip_fragment_shader *pstipfs = CALLOC_STRUCT(pstip_fragment_shader);
 
    if (pstipfs) {
-      pstipfs->state = *fs;
+      pstipfs->state.tokens = tgsi_dup_tokens(fs->tokens);
 
       /* pass-through */
       pstipfs->driver_fs = pstip->driver_create_fs_state(pstip->pipe, fs);
@@ -707,6 +707,7 @@ pstip_delete_fs_state(struct pipe_context *pipe, void *fs)
    if (pstipfs->pstip_fs)
       pstip->driver_delete_fs_state(pstip->pipe, pstipfs->pstip_fs);
 
+   FREE((void*)pstipfs->state.tokens);
    FREE(pstipfs);
 }