diff options
author | Keith Whitwell <[email protected]> | 2008-05-28 13:33:09 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-05-28 13:33:09 +0100 |
commit | 7fd6cd9af31a6b02564359f820d478ceb970fc7d (patch) | |
tree | 27fb226b252e7c64653c670e1d0831ce19bcb725 /src/gallium/drivers/softpipe/sp_context.c | |
parent | 44a7bd0019b9af9ff01336df0aa6eb206f5dc2e9 (diff) | |
parent | b7b9ce0f8677993c3cd5376add72a684a5653341 (diff) |
Merge branch 'gallium-vertex-linear' into gallium-tex-surfaces
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_context.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_context.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index 2af0db37143..045a1f74a95 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -88,7 +88,8 @@ static void softpipe_destroy( struct pipe_context *pipe ) struct pipe_winsys *ws = pipe->winsys; uint i; - draw_destroy( softpipe->draw ); + if (softpipe->draw) + draw_destroy( softpipe->draw ); softpipe->quad.polygon_stipple->destroy( softpipe->quad.polygon_stipple ); softpipe->quad.earlyz->destroy( softpipe->quad.earlyz ); @@ -216,17 +217,23 @@ softpipe_create( struct pipe_screen *screen, * Create drawing context and plug our rendering stage into it. */ softpipe->draw = draw_create(); - assert(softpipe->draw); + if (!softpipe->draw) + goto fail; + softpipe->setup = sp_draw_render_stage(softpipe); + if (!softpipe->setup) + goto fail; if (GETENV( "SP_NO_RAST" ) != NULL) softpipe->no_rast = TRUE; - if (GETENV( "SP_VBUF" ) != NULL) { - sp_init_vbuf(softpipe); + if (GETENV( "SP_NO_VBUF" ) != NULL) { + /* Deprecated path -- vbuf is the intended interface to the draw module: + */ + draw_set_rasterize_stage(softpipe->draw, softpipe->setup); } else { - draw_set_rasterize_stage(softpipe->draw, softpipe->setup); + sp_init_vbuf(softpipe); } /* plug in AA line/point stages */ @@ -241,4 +248,8 @@ softpipe_create( struct pipe_screen *screen, sp_init_surface_functions(softpipe); return &softpipe->pipe; + + fail: + softpipe_destroy(&softpipe->pipe); + return NULL; } |