From: Brian Date: Fri, 17 Aug 2007 18:19:40 +0000 (-0600) Subject: added pipe ptr to draw_context X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a30939714cdc73cb633672cad7d86b425781526d;p=mesa.git added pipe ptr to draw_context --- diff --git a/src/mesa/pipe/draw/draw_private.h b/src/mesa/pipe/draw/draw_private.h index 2748772fdb2..278950ec483 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 52a54a2c961..ac7ae9a887d 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 );