diff options
author | Keith Whitwell <[email protected]> | 2009-11-04 20:36:48 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-11-04 20:36:48 +0000 |
commit | c5ed7b6e76a71d34e4a42ebfca092bd99cb39438 (patch) | |
tree | cdeecf7da81d4f85d12abaebdc4c903628a6bf30 /src/gallium/drivers/i965/brw_context.c | |
parent | e18f223da710a6e1f6a08d346951ea66c6a1de99 (diff) |
i965g: plumb in some surface state
Diffstat (limited to 'src/gallium/drivers/i965/brw_context.c')
-rw-r--r-- | src/gallium/drivers/i965/brw_context.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/drivers/i965/brw_context.c b/src/gallium/drivers/i965/brw_context.c index 5accc858a9c..cd8963bebcb 100644 --- a/src/gallium/drivers/i965/brw_context.c +++ b/src/gallium/drivers/i965/brw_context.c @@ -39,6 +39,7 @@ #include "brw_state.h" #include "brw_batchbuffer.h" #include "brw_winsys.h" +#include "brw_screen.h" static void brw_destroy_context( struct pipe_context *pipe ) @@ -46,6 +47,8 @@ static void brw_destroy_context( struct pipe_context *pipe ) struct brw_context *brw = brw_context(pipe); int i; + brw_context_flush( brw ); + brw_batchbuffer_free( brw->batch ); brw_destroy_state(brw); brw_draw_cleanup( brw ); @@ -101,15 +104,12 @@ struct pipe_context *brw_create_context(struct pipe_screen *screen) if (!brw) { debug_printf("%s: failed to alloc context\n", __FUNCTION__); - return GL_FALSE; + return NULL; } - /* We want the GLSL compiler to emit code that uses condition codes */ - //ctx->Shader.EmitCondCodes = GL_TRUE; - //ctx->Shader.EmitNVTempInitialization = GL_TRUE; - brw->base.screen = screen; brw->base.destroy = brw_destroy_context; + brw->sws = brw_screen(screen)->sws; brw_pipe_blend_init( brw ); brw_pipe_depth_stencil_init( brw ); @@ -133,7 +133,15 @@ struct pipe_context *brw_create_context(struct pipe_screen *screen) make_empty_list(&brw->query.active_head); + brw->batch = brw_batchbuffer_alloc( brw->sws ); + if (brw->batch == NULL) + goto fail; return &brw->base; + +fail: + if (brw->batch) + brw_batchbuffer_free( brw->batch ); + return NULL; } |