diff options
author | Brian Paul <[email protected]> | 2008-05-17 10:30:21 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-05-17 10:30:21 -0600 |
commit | 9671f7ae476cadb46f9f8f9d0363f24aabaf9f87 (patch) | |
tree | 8fb1c3b27bc41cb5b2a5a144746d5eb5991facbc /src/gallium/drivers/softpipe/sp_fs_exec.c | |
parent | 718a2d8c7a125609a8dca813703047e24de09653 (diff) |
gallium: in drivers, make copy of tokens passed to pipe->create_vs/fs_state()
The caller can then free the token array immediately.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_fs_exec.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_fs_exec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_fs_exec.c b/src/gallium/drivers/softpipe/sp_fs_exec.c index d5bd7a702f1..0b199a2193e 100644 --- a/src/gallium/drivers/softpipe/sp_fs_exec.c +++ b/src/gallium/drivers/softpipe/sp_fs_exec.c @@ -37,6 +37,7 @@ #include "pipe/p_util.h" #include "pipe/p_inlines.h" #include "tgsi/exec/tgsi_exec.h" +#include "tgsi/util/tgsi_parse.h" struct sp_exec_fragment_shader { struct sp_fragment_shader base; @@ -116,6 +117,7 @@ exec_run( const struct sp_fragment_shader *base, static void exec_delete( struct sp_fragment_shader *base ) { + FREE((void *) base->shader.tokens); FREE(base); } @@ -137,7 +139,8 @@ softpipe_create_fs_exec(struct softpipe_context *softpipe, if (!shader) return NULL; - shader->base.shader = *templ; + /* we need to keep a local copy of the tokens */ + shader->base.shader.tokens = tgsi_dup_tokens(templ->tokens); shader->base.prepare = exec_prepare; shader->base.run = exec_run; shader->base.delete = exec_delete; |