softpipe: implement SP_NO_RAST env var
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 22 Apr 2008 10:01:41 +0000 (11:01 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 22 Apr 2008 10:02:24 +0000 (11:02 +0100)
src/gallium/drivers/softpipe/sp_clear.c
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_context.h
src/gallium/drivers/softpipe/sp_setup.c

index 39aed151c73f1a2d5221c3a5acf2b146f6f22563..12367068917245835157dd654709f1253e8cc947 100644 (file)
@@ -49,6 +49,9 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
    struct softpipe_context *softpipe = softpipe_context(pipe);
    uint i;
 
+   if (softpipe->no_rast)
+      return;
+
 #if 0
    softpipe_update_derived(softpipe); /* not needed?? */
 #endif
index 8c84ddbe19630e109f92ee0941aaeb5d63c6df18..200fb415acfd41b00467100b16e0ca7a417ee171 100644 (file)
@@ -219,6 +219,9 @@ softpipe_create( struct pipe_screen *screen,
    assert(softpipe->draw);
    softpipe->setup = sp_draw_render_stage(softpipe);
 
+   if (GETENV( "SP_NO_RAST" ) != NULL)
+      softpipe->no_rast = TRUE;
+
    if (GETENV( "SP_VBUF" ) != NULL) {
       sp_init_vbuf(softpipe);
    }
index 0e1d5e561d97767ec0dd51bf01e23a2f6b5f287d..b3e2b2e4355b28d08c7bbf0688865714be84df68 100644 (file)
@@ -86,6 +86,8 @@ struct softpipe_context {
    unsigned num_vertex_elements;
    unsigned num_vertex_buffers;
 
+   boolean no_rast;
+
    /* Counter for occlusion queries.  Note this supports overlapping
     * queries.
     */
index 813d7031083b5a0fefbdb1d33099b4724c531613..0bf2b2dc3ed0476b0133f7bd7767bde791b9d745 100644 (file)
@@ -726,6 +726,9 @@ void setup_tri( struct setup_context *setup,
 {
    float det = calc_det(v0, v1, v2);
 
+   if (setup->softpipe->no_rast)
+      return;
+
    /*
    debug_printf("%s\n", __FUNCTION__ );
    */
@@ -934,6 +937,9 @@ setup_line(struct setup_context *setup,
    int dy = y1 - y0;
    int xstep, ystep;
 
+   if (setup->softpipe->no_rast)
+      return;
+
    if (dx == 0 && dy == 0)
       return;
 
@@ -1052,6 +1058,10 @@ setup_point( struct setup_context *setup,
    const struct vertex_info *vinfo = softpipe_get_vertex_info(softpipe);
    uint fragSlot;
 
+
+   if (softpipe->no_rast)
+      return;
+
    /* For points, all interpolants are constant-valued.
     * However, for point sprites, we'll need to setup texcoords appropriately.
     * XXX: which coefficients are the texcoords???