nvc0: do not set tiled mode on gart bo when fence debugging is used
[mesa.git] / src / gallium / drivers / llvmpipe / lp_state_gs.c
index e5eeb88e2baf89cf2a565f363475eff127ceb91c..b18795cdc4fdf46bd457be11d1769589bc47b81d 100644 (file)
@@ -33,7 +33,6 @@
 #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"
@@ -54,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;
 
@@ -100,6 +102,7 @@ llvmpipe_delete_gs_state(struct pipe_context *pipe, void *gs)
 
    draw_delete_geometry_shader(llvmpipe->draw,
                                (state) ? state->draw_data : 0);
+   FREE( (void *)state->shader.tokens );
    FREE(state);
 }