summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/draw/draw_private.h2
-rw-r--r--src/mesa/pipe/softpipe/sp_draw_arrays.c10
2 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/pipe/draw/draw_private.h b/src/mesa/pipe/draw/draw_private.h
index 2748772fdb..278950ec48 100644
--- a/src/mesa/pipe/draw/draw_private.h
+++ b/src/mesa/pipe/draw/draw_private.h
@@ -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:
*/
diff --git a/src/mesa/pipe/softpipe/sp_draw_arrays.c b/src/mesa/pipe/softpipe/sp_draw_arrays.c
index 52a54a2c96..ac7ae9a887 100644
--- a/src/mesa/pipe/softpipe/sp_draw_arrays.c
+++ b/src/mesa/pipe/softpipe/sp_draw_arrays.c
@@ -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 );