summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pipe_aaline.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2011-09-23 16:32:31 +0100
committerJosé Fonseca <jfonseca@vmware.com>2011-09-25 11:04:29 +0100
commitfc31f9a3f255c5565ce2a3e9c73415bc17199e28 (patch)
treec1a167066edf24579c6974bd9770ad21d9f4a81d /src/gallium/auxiliary/draw/draw_pipe_aaline.c
parent06ae4a62b1b3c668a5b50661df25d87f8c2679ef (diff)
downloadexternal_mesa3d-fc31f9a3f255c5565ce2a3e9c73415bc17199e28.tar.gz
external_mesa3d-fc31f9a3f255c5565ce2a3e9c73415bc17199e28.tar.bz2
external_mesa3d-fc31f9a3f255c5565ce2a3e9c73415bc17199e28.zip
draw: Make copy of the TGSI tokens.
There is no guarantee that the tokens TGSI will persist beyond the create_fs_state. The pipe driver (and therefore the draw module) is responsible for making copies of the TGSI tokens when it needs them. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_aaline.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aaline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index 458f85def2..7ecd2aa3f4 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -848,7 +848,7 @@ aaline_create_fs_state(struct pipe_context *pipe,
if (aafs == NULL)
return NULL;
- aafs->state = *fs;
+ aafs->state.tokens = tgsi_dup_tokens(fs->tokens);
/* pass-through */
aafs->driver_fs = aaline->driver_create_fs_state(pipe, fs);
@@ -882,6 +882,8 @@ aaline_delete_fs_state(struct pipe_context *pipe, void *fs)
if (aafs->aaline_fs)
aaline->driver_delete_fs_state(pipe, aafs->aaline_fs);
+ FREE((void*)aafs->state.tokens);
+
FREE(aafs);
}