summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_aapoint.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-29 10:07:44 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-02-29 10:08:16 -0700
commit78220aea864c36038f8425ad9d8467d2a2bdea58 (patch)
tree8bfeccb26d8c1ca588fd6f6343ea82037af703a2 /src/gallium/auxiliary/draw/draw_aapoint.c
parentebe3b34ad225e320a09bb4069ce4d24808386327 (diff)
gallium: remove the ugly pipe->draw stage lookup code in aaline/point/pstipple stages
Added a void *draw ptr to pipe_context. Probably look for a better solution someday.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_aapoint.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_aapoint.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/gallium/auxiliary/draw/draw_aapoint.c b/src/gallium/auxiliary/draw/draw_aapoint.c
index d48a416899..70f696475f 100644
--- a/src/gallium/auxiliary/draw/draw_aapoint.c
+++ b/src/gallium/auxiliary/draw/draw_aapoint.c
@@ -762,35 +762,11 @@ draw_aapoint_stage(struct draw_context *draw)
}
-/*
- * XXX temporary? solution to mapping a pipe_context to a aapoint_stage.
- */
-
-#define MAX_CONTEXTS 10
-
-static struct pipe_context *Pipe[MAX_CONTEXTS];
-static struct aapoint_stage *Stage[MAX_CONTEXTS];
-static uint NumContexts;
-
-static void
-add_aa_pipe_context(struct pipe_context *pipe, struct aapoint_stage *aa)
-{
- assert(NumContexts < MAX_CONTEXTS);
- Pipe[NumContexts] = pipe;
- Stage[NumContexts] = aa;
- NumContexts++;
-}
-
static struct aapoint_stage *
aapoint_stage_from_pipe(struct pipe_context *pipe)
{
- uint i;
- for (i = 0; i < NumContexts; i++) {
- if (Pipe[i] == pipe)
- return Stage[i];
- }
- assert(0);
- return NULL;
+ struct draw_context *draw = (struct draw_context *) pipe->draw;
+ return aapoint_stage(draw->pipeline.aapoint);
}
@@ -850,6 +826,8 @@ draw_install_aapoint_stage(struct draw_context *draw,
{
struct aapoint_stage *aapoint;
+ pipe->draw = (void *) draw;
+
/*
* Create / install AA point drawing / prim stage
*/
@@ -868,6 +846,4 @@ draw_install_aapoint_stage(struct draw_context *draw,
pipe->create_fs_state = aapoint_create_fs_state;
pipe->bind_fs_state = aapoint_bind_fs_state;
pipe->delete_fs_state = aapoint_delete_fs_state;
-
- add_aa_pipe_context(pipe, aapoint);
}