softpipe: add option to do polygon stipple in softpipe vs. draw module
authorBrian Paul <brianp@vmware.com>
Sat, 17 Apr 2010 17:53:35 +0000 (11:53 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 19 Apr 2010 14:51:07 +0000 (08:51 -0600)
For debugging purposes.

src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_context.h
src/gallium/drivers/softpipe/sp_quad_pipe.c

index 39296aa351fea7468b1efb408fec8cc20bfa4168..9dcb5586c6e5857e11de622e900909378ac3cdc2 100644 (file)
@@ -93,6 +93,7 @@ softpipe_destroy( struct pipe_context *pipe )
    softpipe->quad.shade->destroy( softpipe->quad.shade );
    softpipe->quad.depth_test->destroy( softpipe->quad.depth_test );
    softpipe->quad.blend->destroy( softpipe->quad.blend );
+   softpipe->quad.pstipple->destroy( softpipe->quad.pstipple );
 
    for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
       sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
@@ -296,6 +297,7 @@ softpipe_create_context( struct pipe_screen *screen,
    softpipe->quad.shade = sp_quad_shade_stage(softpipe);
    softpipe->quad.depth_test = sp_quad_depth_test_stage(softpipe);
    softpipe->quad.blend = sp_quad_blend_stage(softpipe);
+   softpipe->quad.pstipple = sp_quad_polygon_stipple_stage(softpipe);
 
 
    /*
@@ -330,7 +332,9 @@ softpipe_create_context( struct pipe_screen *screen,
    draw_install_aapoint_stage(softpipe->draw, &softpipe->pipe);
 
    /* Do polygon stipple w/ texture map + frag prog? */
+#if DO_PSTIPPLE_IN_DRAW_MODULE
    draw_install_pstipple_stage(softpipe->draw, &softpipe->pipe);
+#endif
 
    sp_init_surface_functions(softpipe);
 
index be8f2cb3e04086615192663da418d8204ad1a298..92607874b60912f4f0d3551be46b1d2615a87cfe 100644 (file)
 #include "sp_quad_pipe.h"
 
 
+/** Do polygon stipple in the driver here, or in the draw module? */
+#define DO_PSTIPPLE_IN_DRAW_MODULE 1
+
+
 struct softpipe_vbuf_render;
 struct draw_context;
 struct draw_stage;
@@ -126,6 +130,7 @@ struct softpipe_context {
       struct quad_stage *shade;
       struct quad_stage *depth_test;
       struct quad_stage *blend;
+      struct quad_stage *pstipple;
       struct quad_stage *first; /**< points to one of the above stages */
    } quad;
 
index 1b5bab4eca6c0d39d7abc6a0a00dabdeb3f1b1a8..43b8e88e334e697c95fcb7d8a0eaa49c9c59e8b8 100644 (file)
@@ -59,5 +59,10 @@ sp_build_quad_pipeline(struct softpipe_context *sp)
       sp_push_quad_first( sp, sp->quad.depth_test );
       sp_push_quad_first( sp, sp->quad.shade );
    }
+
+#if !DO_PSTIPPLE_IN_DRAW_MODULE
+   if (sp->rasterizer->poly_stipple_enable)
+      sp_push_quad_first( sp, sp->quad.pstipple );
+#endif
 }