summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pt.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-04-19 13:20:26 +0100
committerKeith Whitwell <[email protected]>2008-04-19 13:20:26 +0100
commit1246d06313f443c91dea07239b43a88ba2b86dde (patch)
tree312ac965e387f6fc5323ce2aa9562031ceba23fd /src/gallium/auxiliary/draw/draw_pt.c
parent882e5d84dcb19c24b7b56cfe6049810023f3a17e (diff)
draw: remove named clipmask flags, tidy up pt middle ends
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index ecaed840700..f153a3ee2cc 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -44,7 +44,7 @@
* - pipeline -- the prim pipeline: clipping, wide lines, etc
* - backend -- the vbuf_render provided by the driver.
*/
-boolean
+static boolean
draw_pt_arrays(struct draw_context *draw,
unsigned prim,
unsigned start,
@@ -70,19 +70,16 @@ draw_pt_arrays(struct draw_context *draw,
opt |= PT_SHADE;
}
+ if (opt)
+ middle = draw->pt.middle.general;
+ else
+ middle = draw->pt.middle.fetch_emit;
- middle = draw->pt.middle.opt[opt];
- if (middle == NULL) {
- middle = draw->pt.middle.opt[PT_PIPELINE | PT_CLIPTEST | PT_SHADE];
- }
-
- assert(middle);
/* May create a short-circuited version of this for small primitives:
*/
frontend = draw->pt.front.vcache;
-
frontend->prepare( frontend, prim, middle, opt );
frontend->run( frontend,
@@ -102,11 +99,12 @@ boolean draw_pt_init( struct draw_context *draw )
if (!draw->pt.front.vcache)
return FALSE;
- draw->pt.middle.opt[0] = draw_pt_fetch_emit( draw );
- draw->pt.middle.opt[PT_SHADE | PT_CLIPTEST | PT_PIPELINE] =
- draw_pt_fetch_pipeline_or_emit( draw );
+ draw->pt.middle.fetch_emit = draw_pt_fetch_emit( draw );
+ if (!draw->pt.middle.fetch_emit)
+ return FALSE;
- if (!draw->pt.middle.opt[PT_SHADE | PT_CLIPTEST | PT_PIPELINE])
+ draw->pt.middle.general = draw_pt_fetch_pipeline_or_emit( draw );
+ if (!draw->pt.middle.general)
return FALSE;
return TRUE;
@@ -115,13 +113,15 @@ boolean draw_pt_init( struct draw_context *draw )
void draw_pt_destroy( struct draw_context *draw )
{
- int i;
+ if (draw->pt.middle.general) {
+ draw->pt.middle.general->destroy( draw->pt.middle.general );
+ draw->pt.middle.general = NULL;
+ }
- for (i = 0; i < PT_MAX_MIDDLE; i++)
- if (draw->pt.middle.opt[i]) {
- draw->pt.middle.opt[i]->destroy( draw->pt.middle.opt[i] );
- draw->pt.middle.opt[i] = NULL;
- }
+ if (draw->pt.middle.fetch_emit) {
+ draw->pt.middle.fetch_emit->destroy( draw->pt.middle.fetch_emit );
+ draw->pt.middle.fetch_emit = NULL;
+ }
if (draw->pt.front.vcache) {
draw->pt.front.vcache->destroy( draw->pt.front.vcache );