summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-10-03 12:00:52 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-10-03 12:01:18 -0400
commit07cd46d111b063ed37391ad7c316db9d7927ad03 (patch)
treeb135f42818024aec5dbdf662f191f8ddb7fb18a6 /src/mesa/pipe
parentb46926c4beff4ac14ac0cf2e3bc52f8118ed4d2a (diff)
In vertex shaders also expect the template to be stack allocated
structure so allocate a private copy of it.
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_state_fs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_fs.c b/src/mesa/pipe/softpipe/sp_state_fs.c
index 390340fa8d..88d9bd9716 100644
--- a/src/mesa/pipe/softpipe/sp_state_fs.c
+++ b/src/mesa/pipe/softpipe/sp_state_fs.c
@@ -67,8 +67,11 @@ void * softpipe_create_vs_state(struct pipe_context *pipe,
struct softpipe_context *softpipe = softpipe_context(pipe);
struct sp_vertex_shader_state *state =
malloc(sizeof(struct sp_vertex_shader_state));
+ struct pipe_shader_state *templ_copy =
+ malloc(sizeof(struct pipe_shader_state));
+ memcpy(templ_copy, templ, sizeof(struct pipe_shader_state));
- state->state = templ;
+ state->state = templ_copy;
state->draw_data = draw_create_vertex_shader(softpipe->draw,
state->state);
@@ -95,6 +98,7 @@ void softpipe_delete_vs_state(struct pipe_context *pipe,
(struct sp_vertex_shader_state *)vs;
draw_delete_vertex_shader(softpipe->draw, state->draw_data);
+ free(state->state);
free(state);
}