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 39aed15..1236706 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 8c84ddb..200fb41 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 0e1d5e5..b3e2b2e 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 813d703..0bf2b2d 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???