summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_draw_arrays.c15
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_gs.c21
2 files changed, 27 insertions, 9 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
index ae00c49d490..efeca255755 100644
--- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
+++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
@@ -101,6 +101,13 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
llvmpipe_prepare_geometry_sampling(lp,
lp->num_sampler_views[PIPE_SHADER_GEOMETRY],
lp->sampler_views[PIPE_SHADER_GEOMETRY]);
+ if (lp->gs && !lp->gs->shader.tokens) {
+ /* we have an empty geometry shader with stream output, so
+ attach the stream output info to the current vertex shader */
+ if (lp->vs) {
+ draw_vs_attach_so(lp->vs->draw_data, &lp->gs->shader.stream_output);
+ }
+ }
/* draw! */
draw_vbo(draw, info);
@@ -116,6 +123,14 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
}
draw_set_mapped_so_targets(draw, 0, NULL);
+ if (lp->gs && !lp->gs->shader.tokens) {
+ /* we have attached stream output to the vs for rendering,
+ now lets reset it */
+ if (lp->vs) {
+ draw_vs_reset_so(lp->vs->draw_data);
+ }
+ }
+
llvmpipe_cleanup_vertex_sampling(lp);
llvmpipe_cleanup_geometry_sampling(lp);
diff --git a/src/gallium/drivers/llvmpipe/lp_state_gs.c b/src/gallium/drivers/llvmpipe/lp_state_gs.c
index fd6f5f7d0da..b18795cdc4f 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;