added pipe ptr to draw_context
authorBrian <brian.paul@tungstengraphics.com>
Fri, 17 Aug 2007 18:19:40 +0000 (12:19 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 17 Aug 2007 18:19:40 +0000 (12:19 -0600)
src/mesa/pipe/draw/draw_private.h
src/mesa/pipe/softpipe/sp_draw_arrays.c

index 2748772..278950e 100644 (file)
@@ -161,6 +161,8 @@ struct draw_context
    const struct pipe_vertex_buffer *vertex_buffer;  /**< note: pointer */
    const struct pipe_vertex_element *vertex_element; /**< note: pointer */
 
+   /** need to know the pipe for vertex flushing/transformation: */
+   struct pipe_context *pipe;
 
    /* Clip derived state:
     */
index 52a54a2..ac7ae9a 100644 (file)
@@ -61,9 +61,6 @@
 #endif
 
 
-static struct softpipe_context *sp_global = NULL;
-
-
 
 static INLINE unsigned
 compute_clipmask(float cx, float cy, float cz, float cw)
@@ -104,9 +101,7 @@ run_vertex_program(struct draw_context *draw,
                    const void *vbuffer, unsigned elts[4], unsigned count,
                    struct vertex_header *vOut[])
 {
-#if 1
-   struct softpipe_context *sp = sp_global;
-#endif
+   struct softpipe_context *sp = softpipe_context(draw->pipe);
    struct tgsi_exec_machine machine;
    unsigned int j;
 
@@ -368,8 +363,6 @@ softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
    struct draw_context *draw = sp->draw;
    struct pipe_buffer_handle *buf;
 
-   sp_global = sp;
-
    softpipe_map_surfaces(sp);
 
    /*
@@ -384,6 +377,7 @@ softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
    draw->pipeline.first->begin( draw->pipeline.first );
 
    draw->vs_flush = vs_flush;
+   draw->pipe = pipe;  /* XXX pass pipe to draw_create() */
 
    draw_invalidate_vcache( draw );