summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-04-19 12:51:07 -0700
committerZack Rusin <[email protected]>2013-04-22 20:36:07 -0400
commit2aad06844fe50deeb905417ed75d3d167a947d5a (patch)
treec9f07007b7da159650cbf3d30de27c289651ab01 /src/gallium
parent723b78397fbad8987e14b7bb2376055529f40856 (diff)
softpipe: fix streamout with an emptry geometry shader
Same approach as in the llvmpipe, if the geometry shader is null and we have stream output then attach it to the vertex shader right before executing the draw pipeline. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/softpipe/sp_draw_arrays.c7
-rw-r--r--src/gallium/drivers/softpipe/sp_state_shader.c28
2 files changed, 23 insertions, 12 deletions
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index 4378312bc36..0eb9c5024df 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -105,6 +105,13 @@ softpipe_draw_vbo(struct pipe_context *pipe,
draw_set_mapped_so_targets(draw, sp->num_so_targets,
sp->so_targets);
+ if (sp->gs && !sp->gs->shader.tokens) {
+ /* we have an empty geometry shader with stream output, so
+ attach the stream output info to the current vertex shader */
+ if (sp->vs) {
+ draw_vs_attach_so(sp->vs->draw_data, &sp->gs->shader.stream_output);
+ }
+ }
draw_collect_pipeline_statistics(draw,
sp->active_statistics_queries > 0);
diff --git a/src/gallium/drivers/softpipe/sp_state_shader.c b/src/gallium/drivers/softpipe/sp_state_shader.c
index 40d32a4dfb0..79bd597ebcb 100644
--- a/src/gallium/drivers/softpipe/sp_state_shader.c
+++ b/src/gallium/drivers/softpipe/sp_state_shader.c
@@ -275,21 +275,25 @@ softpipe_create_gs_state(struct pipe_context *pipe,
if (state == NULL )
goto fail;
- /* debug */
- if (softpipe->dump_gs)
- tgsi_dump(templ->tokens, 0);
+ state->shader = *templ;
- /* 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;
+ if (templ->tokens) {
+ /* debug */
+ if (softpipe->dump_gs)
+ tgsi_dump(templ->tokens, 0);
- state->draw_data = draw_create_geometry_shader(softpipe->draw, templ);
- if (state->draw_data == NULL)
- goto fail;
+ /* 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->max_sampler = state->draw_data->info.file_max[TGSI_FILE_SAMPLER];
+ state->draw_data = draw_create_geometry_shader(softpipe->draw, templ);
+ if (state->draw_data == NULL)
+ goto fail;
+
+ state->max_sampler = state->draw_data->info.file_max[TGSI_FILE_SAMPLER];
+ }
return state;