#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "draw/draw_context.h"
-#include "draw/draw_vs.h"
#include "tgsi/tgsi_dump.h"
#include "tgsi/tgsi_scan.h"
#include "tgsi/tgsi_parse.h"
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;
draw_delete_geometry_shader(llvmpipe->draw,
(state) ? state->draw_data : 0);
+ FREE( (void *)state->shader.tokens );
FREE(state);
}