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);
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;