Added a void *draw ptr to pipe_context. Probably look for a better solution someday.
}
-/*
- * XXX temporary? solution to mapping a pipe_context to a aaline_stage.
- */
-
-#define MAX_CONTEXTS 10
-
-static struct pipe_context *Pipe[MAX_CONTEXTS];
-static struct aaline_stage *Stage[MAX_CONTEXTS];
-static uint NumContexts;
-
-static void
-add_aa_pipe_context(struct pipe_context *pipe, struct aaline_stage *aa)
-{
- assert(NumContexts < MAX_CONTEXTS);
- Pipe[NumContexts] = pipe;
- Stage[NumContexts] = aa;
- NumContexts++;
-}
-
static struct aaline_stage *
aaline_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 aaline_stage(draw->pipeline.aaline);
}
{
struct aaline_stage *aaline;
+ pipe->draw = (void *) draw;
+
/*
* Create / install AA line drawing / prim stage
*/
pipe->bind_sampler_state = aaline_bind_sampler_state;
pipe->set_sampler_texture = aaline_set_sampler_texture;
-
- add_aa_pipe_context(pipe, aaline);
}
}
-/*
- * 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);
}
{
struct aapoint_stage *aapoint;
+ pipe->draw = (void *) draw;
+
/*
* Create / install AA point drawing / prim stage
*/
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);
}
}
-/*
- * XXX temporary? solution to mapping a pipe_context to a pstip_stage.
- */
-
-#define MAX_CONTEXTS 10
-
-static struct pipe_context *Pipe[MAX_CONTEXTS];
-static struct pstip_stage *Stage[MAX_CONTEXTS];
-static uint NumContexts;
-
-static void
-add_pstip_pipe_context(struct pipe_context *pipe, struct pstip_stage *pstip)
-{
- assert(NumContexts < MAX_CONTEXTS);
- Pipe[NumContexts] = pipe;
- Stage[NumContexts] = pstip;
- NumContexts++;
-}
-
static struct pstip_stage *
pstip_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 pstip_stage(draw->pipeline.pstipple);
}
{
struct pstip_stage *pstip;
+ pipe->draw = (void *) draw;
+
/*
* Create / install AA line drawing / prim stage
*/
pipe->bind_sampler_state = pstip_bind_sampler_state;
pipe->set_sampler_texture = pstip_set_sampler_texture;
pipe->set_polygon_stipple = pstip_set_polygon_stipple;
-
- add_pstip_pipe_context(pipe, pstip);
}
struct pipe_screen *screen;
void *priv; /** context private data (for DRI for example) */
+ void *draw; /** private, for draw module (temporary? */
void (*destroy)( struct pipe_context * );