draw: consolidate all the passthrough line/tri/point funcs
authorKeith Whitwell <keith@tungstengraphics.com>
Mon, 21 Apr 2008 15:10:13 +0000 (16:10 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Mon, 21 Apr 2008 15:16:16 +0000 (16:16 +0100)
16 files changed:
src/gallium/auxiliary/draw/Makefile
src/gallium/auxiliary/draw/SConscript
src/gallium/auxiliary/draw/draw_pipe.c
src/gallium/auxiliary/draw/draw_pipe.h
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_aapoint.c
src/gallium/auxiliary/draw/draw_pipe_cull.c
src/gallium/auxiliary/draw/draw_pipe_flatshade.c
src/gallium/auxiliary/draw/draw_pipe_offset.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/draw/draw_pipe_stipple.c
src/gallium/auxiliary/draw/draw_pipe_twoside.c
src/gallium/auxiliary/draw/draw_pipe_unfilled.c
src/gallium/auxiliary/draw/draw_pipe_util.c [new file with mode: 0644]
src/gallium/auxiliary/draw/draw_pipe_wide_line.c
src/gallium/auxiliary/draw/draw_pipe_wide_point.c

index 5289f2660afdccce051e967701da7496b7663f97..bc6acfe4589c426ac8f0dfb6281b1119e9efb35f 100644 (file)
@@ -16,6 +16,7 @@ C_SOURCES = \
        draw_pipe_stipple.c \
        draw_pipe_twoside.c \
        draw_pipe_unfilled.c \
+       draw_pipe_util.c \
        draw_pipe_validate.c \
        draw_pipe_vbuf.c \
        draw_pipe_wide_line.c \
index 91e6a35c5e83749a9034a0e0bb8a1e0fb9639ed5..0b9852f633eb7389c382a745512dbbbed6251caa 100644 (file)
@@ -15,6 +15,7 @@ draw = env.ConvenienceLibrary(
                'draw_pipe_stipple.c',
                'draw_pipe_twoside.c',
                'draw_pipe_unfilled.c',
+               'draw_pipe_util.c',
                'draw_pipe_validate.c',
                'draw_pipe_vbuf.c',
                'draw_pipe_wide_line.c',
index 0c0840af0ccb550c1102602da4fd607774736c35..d0890203a5eeef6431cb1bfc9eb2aa19402cb6e3 100644 (file)
@@ -108,40 +108,6 @@ void draw_pipeline_destroy( struct draw_context *draw )
 
 
 
-/* This is only used for temporary verts.
- */
-#define MAX_VERTEX_SIZE ((2 + PIPE_MAX_SHADER_OUTPUTS) * 4 * sizeof(float))
-
-
-/**
- * Allocate space for temporary post-transform vertices, such as for clipping.
- */
-void draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr )
-{
-   assert(!stage->tmp);
-
-   stage->nr_tmps = nr;
-
-   if (nr) {
-      ubyte *store = (ubyte *) MALLOC( MAX_VERTEX_SIZE * nr );
-      unsigned i;
-
-      stage->tmp = (struct vertex_header **) MALLOC( sizeof(struct vertex_header *) * nr );
-      
-      for (i = 0; i < nr; i++)
-        stage->tmp[i] = (struct vertex_header *)(store + i * MAX_VERTEX_SIZE);
-   }
-}
-
-
-void draw_free_temp_verts( struct draw_stage *stage )
-{
-   if (stage->tmp) {
-      FREE( stage->tmp[0] );
-      FREE( stage->tmp );
-      stage->tmp = NULL;
-   }
-}
 
 
 
@@ -195,35 +161,6 @@ static void do_triangle( struct draw_context *draw,
 }
 
 
-/* Reset vertex ids.  This is basically a type of flush.
- *
- * Called only from draw_pipe_vbuf.c
- */
-void draw_reset_vertex_ids(struct draw_context *draw)
-{
-   struct draw_stage *stage = draw->pipeline.first;
-   
-   while (stage) {
-      unsigned i;
-
-      for (i = 0; i < stage->nr_tmps; i++)
-        stage->tmp[i]->vertex_id = UNDEFINED_VERTEX_ID;
-
-      stage = stage->next;
-   }
-
-   if (draw->pipeline.verts)
-   {
-      unsigned i;
-      char *verts = draw->pipeline.verts;
-      unsigned stride = draw->pipeline.vertex_stride;
-
-      for (i = 0; i < draw->pipeline.vertex_count; i++) {
-         ((struct vertex_header *)verts)->vertex_id = UNDEFINED_VERTEX_ID;
-         verts += stride;
-      }
-   }
-}
 
 
 /* Code to run the pipeline on a fairly arbitary collection of vertices.
index f2749b34bbb4ad4a63a998f0f671946df9da7637..2476abb2b2345da6df1aa8fbe735a39201672972 100644 (file)
@@ -81,10 +81,14 @@ extern struct draw_stage *draw_validate_stage( struct draw_context *context );
 
 
 extern void draw_free_temp_verts( struct draw_stage *stage );
-extern void draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr );
+extern boolean draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr );
 
 extern void draw_reset_vertex_ids( struct draw_context *draw );
 
+void draw_pipe_passthrough_tri(struct draw_stage *stage, struct prim_header *header);
+void draw_pipe_passthrough_line(struct draw_stage *stage, struct prim_header *header);
+void draw_pipe_passthrough_point(struct draw_stage *stage, struct prim_header *header);
+
 
 
 /**
index 24bc87d4f8e362e5a27855402bd7ebd67e534bf3..b27360170a175ff68ea50e2334c394636af9e4d6 100644 (file)
@@ -334,7 +334,7 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
  * Generate the frag shader we'll use for drawing AA lines.
  * This will be the user's shader plus some texture/modulate instructions.
  */
-static void
+static boolean
 generate_aaline_fs(struct aaline_stage *aaline)
 {
    const struct pipe_shader_state *orig_fs = &aaline->fs->state;
@@ -346,6 +346,8 @@ generate_aaline_fs(struct aaline_stage *aaline)
 
    aaline_fs = *orig_fs; /* copy to init */
    aaline_fs.tokens = MALLOC(sizeof(struct tgsi_token) * MAX);
+   if (aaline_fs.tokens == NULL)
+      return FALSE;
 
    memset(&transform, 0, sizeof(transform));
    transform.colorOutput = -1;
@@ -372,6 +374,7 @@ generate_aaline_fs(struct aaline_stage *aaline)
       = aaline->driver_create_fs_state(aaline->pipe, &aaline_fs);
 
    aaline->fs->generic_attrib = transform.maxGeneric + 1;
+   return TRUE;
 }
 
 
@@ -469,13 +472,15 @@ aaline_create_sampler(struct aaline_stage *aaline)
  * When we're about to draw our first AA line in a batch, this function is
  * called to tell the driver to bind our modified fragment shader.
  */
-static void
+static boolean
 bind_aaline_fragment_shader(struct aaline_stage *aaline)
 {
-   if (!aaline->fs->aaline_fs) {
-      generate_aaline_fs(aaline);
-   }
+   if (!aaline->fs->aaline_fs && 
+       !generate_aaline_fs(aaline))
+      return FALSE;
+
    aaline->driver_bind_fs_state(aaline->pipe, aaline->fs->aaline_fs);
+   return TRUE;
 }
 
 
@@ -487,20 +492,6 @@ aaline_stage( struct draw_stage *stage )
 }
 
 
-static void
-passthrough_point(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->point(stage->next, header);
-}
-
-
-static void
-passthrough_tri(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->tri(stage->next, header);
-}
-
-
 /**
  * Draw a wide line by drawing a quad, using geometry which will
  * fullfill GL's antialiased line requirements.
@@ -638,7 +629,10 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
    /*
     * Bind (generate) our fragprog, sampler and texture
     */
-   bind_aaline_fragment_shader(aaline);
+   if (!bind_aaline_fragment_shader(aaline)) {
+      stage->line = draw_pipe_passthrough_line;
+      return;
+   }
 
    /* update vertex attrib info */
    aaline->tex_slot = draw->num_vs_outputs;
@@ -721,9 +715,9 @@ draw_aaline_stage(struct draw_context *draw)
 
    aaline->stage.draw = draw;
    aaline->stage.next = NULL;
-   aaline->stage.point = passthrough_point;
+   aaline->stage.point = draw_pipe_passthrough_point;
    aaline->stage.line = aaline_first_line;
-   aaline->stage.tri = passthrough_tri;
+   aaline->stage.tri = draw_pipe_passthrough_tri;
    aaline->stage.flush = aaline_flush;
    aaline->stage.reset_stipple_counter = aaline_reset_stipple_counter;
    aaline->stage.destroy = aaline_destroy;
index 9f878f6c02f95e6f96f9d9c651a2693167acc139..6d22d7ac48bd37e7e7d2f6ac91e0aa313b5eb186 100644 (file)
@@ -546,18 +546,6 @@ aapoint_stage( struct draw_stage *stage )
 }
 
 
-static void
-passthrough_line(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->line(stage->next, header);
-}
-
-
-static void
-passthrough_tri(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->tri(stage->next, header);
-}
 
 
 /**
@@ -749,8 +737,8 @@ draw_aapoint_stage(struct draw_context *draw)
    aapoint->stage.draw = draw;
    aapoint->stage.next = NULL;
    aapoint->stage.point = aapoint_first_point;
-   aapoint->stage.line = passthrough_line;
-   aapoint->stage.tri = passthrough_tri;
+   aapoint->stage.line = draw_pipe_passthrough_line;
+   aapoint->stage.tri = draw_pipe_passthrough_tri;
    aapoint->stage.flush = aapoint_flush;
    aapoint->stage.reset_stipple_counter = aapoint_reset_stipple_counter;
    aapoint->stage.destroy = aapoint_destroy;
index c406f89d05648510a354e3959134585a90225acf..8c13f40b554c5674233a8081fe52ec624b318c14 100644 (file)
@@ -95,20 +95,6 @@ static void cull_first_tri( struct draw_stage *stage,
 
 
 
-static void cull_line( struct draw_stage *stage,
-                      struct prim_header *header )
-{
-   stage->next->line( stage->next, header );
-}
-
-
-static void cull_point( struct draw_stage *stage,
-                       struct prim_header *header )
-{
-   stage->next->point( stage->next, header );
-}
-
-
 static void cull_flush( struct draw_stage *stage, unsigned flags )
 {
    stage->tri = cull_first_tri;
@@ -139,8 +125,8 @@ struct draw_stage *draw_cull_stage( struct draw_context *draw )
 
    cull->stage.draw = draw;
    cull->stage.next = NULL;
-   cull->stage.point = cull_point;
-   cull->stage.line = cull_line;
+   cull->stage.point = draw_pipe_passthrough_point;
+   cull->stage.line = draw_pipe_passthrough_line;
    cull->stage.tri = cull_first_tri;
    cull->stage.flush = cull_flush;
    cull->stage.reset_stipple_counter = cull_reset_stipple_counter;
index bdb8b49dc4df611ada67e0d2544e789c08542aa4..2aeb3095544ed4abc7d5d5998e7e15974ab1cf42 100644 (file)
@@ -152,13 +152,6 @@ static void flatshade_line_1( struct draw_stage *stage,
 }
 
 
-/* Flatshade point -- passthrough.
- */
-static void flatshade_point( struct draw_stage *stage,
-                             struct prim_header *header )
-{
-   stage->next->point( stage->next, header );
-}
 
 
 static void flatshade_init_state( struct draw_stage *stage )
@@ -236,7 +229,7 @@ struct draw_stage *draw_flatshade_stage( struct draw_context *draw )
 
    flatshade->stage.draw = draw;
    flatshade->stage.next = NULL;
-   flatshade->stage.point = flatshade_point;
+   flatshade->stage.point = draw_pipe_passthrough_point;
    flatshade->stage.line = flatshade_first_line;
    flatshade->stage.tri = flatshade_first_tri;
    flatshade->stage.flush = flatshade_flush;
index dbdece45bb71481614a5f4fb6ddf3b9c6f67cac2..c1dc21cd3293567f51f8eb567a5302e396b4e3a4 100644 (file)
@@ -129,18 +129,6 @@ static void offset_first_tri( struct draw_stage *stage,
 }
 
 
-static void offset_line( struct draw_stage *stage,
-                        struct prim_header *header )
-{
-   stage->next->line( stage->next, header );
-}
-
-
-static void offset_point( struct draw_stage *stage,
-                         struct prim_header *header )
-{
-   stage->next->point( stage->next, header );
-}
 
 
 static void offset_flush( struct draw_stage *stage,
@@ -175,8 +163,8 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw )
 
    offset->stage.draw = draw;
    offset->stage.next = NULL;
-   offset->stage.point = offset_point;
-   offset->stage.line = offset_line;
+   offset->stage.point = draw_pipe_passthrough_point;
+   offset->stage.line = draw_pipe_passthrough_line;
    offset->stage.tri = offset_first_tri;
    offset->stage.flush = offset_flush;
    offset->stage.reset_stipple_counter = offset_reset_stipple_counter;
index 4903ba2133620300f07c118df25db90153c5b9e0..5686729cd3d597a458c0d6f084e7e78d77d08845 100644 (file)
@@ -473,25 +473,6 @@ pstip_stage( struct draw_stage *stage )
 }
 
 
-static void
-passthrough_point(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->point(stage->next, header);
-}
-
-
-static void
-passthrough_line(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->line(stage->next, header);
-}
-
-
-static void
-passthrough_tri(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->tri(stage->next, header);
-}
 
 
 
@@ -523,7 +504,7 @@ pstip_first_tri(struct draw_stage *stage, struct prim_header *header)
    pstip->driver_set_sampler_textures(pipe, num_samplers, pstip->state.textures);
 
    /* now really draw first line */
-   stage->tri = passthrough_tri;
+   stage->tri = draw_pipe_passthrough_tri;
    stage->tri(stage, header);
 }
 
@@ -579,8 +560,8 @@ draw_pstip_stage(struct draw_context *draw)
 
    pstip->stage.draw = draw;
    pstip->stage.next = NULL;
-   pstip->stage.point = passthrough_point;
-   pstip->stage.line = passthrough_line;
+   pstip->stage.point = draw_pipe_passthrough_point;
+   pstip->stage.line = draw_pipe_passthrough_line;
    pstip->stage.tri = pstip_first_tri;
    pstip->stage.flush = pstip_flush;
    pstip->stage.reset_stipple_counter = pstip_reset_stipple_counter;
index 49429ee9e1698a94adce2c15c1ccce8c7df6d526..9cf5840ccee689044cd183148c3e56178414c273 100644 (file)
@@ -195,18 +195,6 @@ stipple_flush(struct draw_stage *stage, unsigned flags)
 }
 
 
-static void
-passthrough_point(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->point( stage->next, header );
-}
-
-
-static void
-passthrough_tri(struct draw_stage *stage, struct prim_header *header)
-{
-   stage->next->tri(stage->next, header);
-}
 
 
 static void 
@@ -228,9 +216,9 @@ struct draw_stage *draw_stipple_stage( struct draw_context *draw )
 
    stipple->stage.draw = draw;
    stipple->stage.next = NULL;
-   stipple->stage.point = passthrough_point;
+   stipple->stage.point = draw_pipe_passthrough_point;
    stipple->stage.line = stipple_first_line;
-   stipple->stage.tri = passthrough_tri;
+   stipple->stage.tri = draw_pipe_passthrough_tri;
    stipple->stage.reset_stipple_counter = reset_stipple_counter;
    stipple->stage.flush = stipple_flush;
    stipple->stage.destroy = stipple_destroy;
index 09a9d23d57e36ab7c5a90d7a53d0a4e0e7ffb5ab..453fd3ac7108c8c09c58ee0898a50cc26d8887f2 100644 (file)
@@ -99,21 +99,6 @@ static void twoside_tri( struct draw_stage *stage,
 }
 
 
-static void twoside_line( struct draw_stage *stage,
-                      struct prim_header *header )
-{
-   /* pass-through */
-   stage->next->line( stage->next, header );
-}
-
-
-static void twoside_point( struct draw_stage *stage,
-                       struct prim_header *header )
-{
-   /* pass-through */
-   stage->next->point( stage->next, header );
-}
-
 
 static void twoside_first_tri( struct draw_stage *stage, 
                               struct prim_header *header )
@@ -192,8 +177,8 @@ struct draw_stage *draw_twoside_stage( struct draw_context *draw )
 
    twoside->stage.draw = draw;
    twoside->stage.next = NULL;
-   twoside->stage.point = twoside_point;
-   twoside->stage.line = twoside_line;
+   twoside->stage.point = draw_pipe_passthrough_point;
+   twoside->stage.line = draw_pipe_passthrough_line;
    twoside->stage.tri = twoside_first_tri;
    twoside->stage.flush = twoside_flush;
    twoside->stage.reset_stipple_counter = twoside_reset_stipple_counter;
index 31e24f6a147e86836c1256227acd076935b54677..d4ddfec1b3aaef284e5ff006dc2f863254e41c51 100644 (file)
@@ -148,19 +148,6 @@ static void unfilled_first_tri( struct draw_stage *stage,
 }
 
 
-static void unfilled_line( struct draw_stage *stage,
-                           struct prim_header *header )
-{
-   stage->next->line( stage->next, header );
-}
-
-
-static void unfilled_point( struct draw_stage *stage,
-                            struct prim_header *header )
-{
-   stage->next->point( stage->next, header );
-}
-
 
 static void unfilled_flush( struct draw_stage *stage,
                            unsigned flags )
@@ -196,8 +183,8 @@ struct draw_stage *draw_unfilled_stage( struct draw_context *draw )
    unfilled->stage.draw = draw;
    unfilled->stage.next = NULL;
    unfilled->stage.tmp = NULL;
-   unfilled->stage.point = unfilled_point;
-   unfilled->stage.line = unfilled_line;
+   unfilled->stage.point = draw_pipe_passthrough_point;
+   unfilled->stage.line = draw_pipe_passthrough_line;
    unfilled->stage.tri = unfilled_first_tri;
    unfilled->stage.flush = unfilled_flush;
    unfilled->stage.reset_stipple_counter = unfilled_reset_stipple_counter;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_util.c b/src/gallium/auxiliary/draw/draw_pipe_util.c
new file mode 100644 (file)
index 0000000..e9821de
--- /dev/null
@@ -0,0 +1,133 @@
+/**************************************************************************
+ * 
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+ /*
+  * Authors:
+  *   Keith Whitwell <keith@tungstengraphics.com>
+  */
+
+#include "pipe/p_util.h"
+#include "draw/draw_private.h"
+#include "draw/draw_pipe.h"
+
+
+
+void
+draw_pipe_passthrough_point(struct draw_stage *stage, struct prim_header *header)
+{
+   stage->next->point(stage->next, header);
+}
+
+void
+draw_pipe_passthrough_line(struct draw_stage *stage, struct prim_header *header)
+{
+   stage->next->line(stage->next, header);
+}
+
+void
+draw_pipe_passthrough_tri(struct draw_stage *stage, struct prim_header *header)
+{
+   stage->next->tri(stage->next, header);
+}
+
+
+
+
+
+/* This is only used for temporary verts.
+ */
+#define MAX_VERTEX_SIZE ((2 + PIPE_MAX_SHADER_OUTPUTS) * 4 * sizeof(float))
+
+
+/**
+ * Allocate space for temporary post-transform vertices, such as for clipping.
+ */
+boolean draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr )
+{
+   unsigned i;
+   ubyte *store;
+
+   assert(!stage->tmp);
+
+   stage->tmp = NULL;
+   stage->nr_tmps = nr;
+   if (nr == 0)
+      return FALSE;
+
+   store = (ubyte *) MALLOC( MAX_VERTEX_SIZE * nr );
+   if (store == NULL)
+      return FALSE;
+
+   stage->tmp = (struct vertex_header **) MALLOC( sizeof(struct vertex_header *) * nr );
+      
+   for (i = 0; i < nr; i++)
+      stage->tmp[i] = (struct vertex_header *)(store + i * MAX_VERTEX_SIZE);
+
+   return TRUE;
+}
+
+
+void draw_free_temp_verts( struct draw_stage *stage )
+{
+   if (stage->tmp) {
+      FREE( stage->tmp[0] );
+      FREE( stage->tmp );
+      stage->tmp = NULL;
+   }
+}
+
+
+/* Reset vertex ids.  This is basically a type of flush.
+ *
+ * Called only from draw_pipe_vbuf.c
+ */
+void draw_reset_vertex_ids(struct draw_context *draw)
+{
+   struct draw_stage *stage = draw->pipeline.first;
+   
+   while (stage) {
+      unsigned i;
+
+      for (i = 0; i < stage->nr_tmps; i++)
+        stage->tmp[i]->vertex_id = UNDEFINED_VERTEX_ID;
+
+      stage = stage->next;
+   }
+
+   if (draw->pipeline.verts)
+   {
+      unsigned i;
+      char *verts = draw->pipeline.verts;
+      unsigned stride = draw->pipeline.vertex_stride;
+
+      for (i = 0; i < draw->pipeline.vertex_count; i++) {
+         ((struct vertex_header *)verts)->vertex_id = UNDEFINED_VERTEX_ID;
+         verts += stride;
+      }
+   }
+}
+
index 329b5d0fb02bee5196b0c0b698e7c013ade5925d..452732e662c2eb38533ca195748e143661aa5aad 100644 (file)
@@ -49,19 +49,6 @@ static INLINE struct wideline_stage *wideline_stage( struct draw_stage *stage )
 }
 
 
-static void wideline_point( struct draw_stage *stage,
-                               struct prim_header *header )
-{
-   stage->next->point( stage->next, header );
-}
-
-
-static void wideline_tri( struct draw_stage *stage,
-                             struct prim_header *header )
-{
-   stage->next->tri(stage->next, header);
-}
-
 
 /**
  * Draw a wide line by drawing a quad (two triangles).
@@ -180,9 +167,9 @@ struct draw_stage *draw_wide_line_stage( struct draw_context *draw )
 
    wide->stage.draw = draw;
    wide->stage.next = NULL;
-   wide->stage.point = wideline_point;
+   wide->stage.point = draw_pipe_passthrough_point;
    wide->stage.line = wideline_line;
-   wide->stage.tri = wideline_tri;
+   wide->stage.tri = draw_pipe_passthrough_point;
    wide->stage.flush = wideline_flush;
    wide->stage.reset_stipple_counter = wideline_reset_stipple_counter;
    wide->stage.destroy = wideline_destroy;
index 7a439178a0ee2775e32b5b49e5a9d2e1e0fa7722..8101340680ec2311003f9c7206204c4951134659 100644 (file)
@@ -61,23 +61,6 @@ widepoint_stage( struct draw_stage *stage )
 }
 
 
-static void passthrough_point( struct draw_stage *stage,
-                             struct prim_header *header )
-{
-   stage->next->point( stage->next, header );
-}
-
-static void widepoint_line( struct draw_stage *stage,
-                            struct prim_header *header )
-{
-   stage->next->line(stage->next, header);
-}
-
-static void widepoint_tri( struct draw_stage *stage,
-                           struct prim_header *header )
-{
-   stage->next->tri(stage->next, header);
-}
 
 
 /**
@@ -209,7 +192,7 @@ static void widepoint_first_point( struct draw_stage *stage,
       stage->point = widepoint_point;
    }
    else {
-      stage->point = passthrough_point;
+      stage->point = draw_pipe_passthrough_point;
    }
 
    if (draw->rasterizer->point_sprite) {
@@ -272,8 +255,8 @@ struct draw_stage *draw_wide_point_stage( struct draw_context *draw )
    wide->stage.draw = draw;
    wide->stage.next = NULL;
    wide->stage.point = widepoint_first_point;
-   wide->stage.line = widepoint_line;
-   wide->stage.tri = widepoint_tri;
+   wide->stage.line = draw_pipe_passthrough_line;
+   wide->stage.tri = draw_pipe_passthrough_tri;
    wide->stage.flush = widepoint_flush;
    wide->stage.reset_stipple_counter = widepoint_reset_stipple_counter;
    wide->stage.destroy = widepoint_destroy;