summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_state_gs.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-03-30 06:21:41 -0700
committerZack Rusin <zackr@vmware.com>2013-04-03 10:16:25 -0700
commit302df7cc85b0e2ce47c40048f30bd116b0d692fc (patch)
tree4af50d5db1d99dda7a1c90659c79425e00f9c0f0 /src/gallium/drivers/llvmpipe/lp_state_gs.c
parent246e68735fe22b4d9f510f8fb1bb8b7bb448b068 (diff)
downloadexternal_mesa3d-302df7cc85b0e2ce47c40048f30bd116b0d692fc.zip
external_mesa3d-302df7cc85b0e2ce47c40048f30bd116b0d692fc.tar.gz
external_mesa3d-302df7cc85b0e2ce47c40048f30bd116b0d692fc.tar.bz2
draw/llvmpipe: allow independent so attachments to the vs
When geometry shaders are present, one needs to be able to create an empty geometry shader with stream output that needs to be resolved later and attached to the currently bound vertex shader. Lets add support for it to llvmpipe and draw. draw allows attaching independent stream output info to any vertex shader and llvmpipe resolves at draw time which vertex shader the given empty geometry shader should be linked to. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_gs.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_gs.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_gs.c b/src/gallium/drivers/llvmpipe/lp_state_gs.c
index fd6f5f7..b18795c 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_gs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_gs.c
@@ -53,15 +53,18 @@ llvmpipe_create_gs_state(struct pipe_context *pipe,
if (0)
tgsi_dump(templ->tokens, 0);
- /* copy shader tokens, the ones passed in will go away.
- */
- state->shader.tokens = tgsi_dup_tokens(templ->tokens);
- if (state->shader.tokens == NULL)
- goto fail;
-
- state->draw_data = draw_create_geometry_shader(llvmpipe->draw, templ);
- if (state->draw_data == NULL)
- goto fail;
+ /* copy stream output info */
+ state->shader = *templ;
+ if (templ->tokens) {
+ /* copy shader tokens, the ones passed in will go away. */
+ state->shader.tokens = tgsi_dup_tokens(templ->tokens);
+ if (state->shader.tokens == NULL)
+ goto fail;
+
+ state->draw_data = draw_create_geometry_shader(llvmpipe->draw, templ);
+ if (state->draw_data == NULL)
+ goto fail;
+ }
return state;