diff options
author | Brian Paul <brianp@vmware.com> | 2009-12-04 14:22:08 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-12-04 14:22:08 -0700 |
commit | 9fca3e065b9ab5ef1389a76934bc24ed2b287a76 (patch) | |
tree | 9c87c76932ce88f405f6ba33ffa4b043a6a3cbd1 | |
parent | a08d6302168341001003da32d42cfcff2311fa04 (diff) |
llvmpipe: simplify framebuffer state code
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 29 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.h | 5 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_context.h | 7 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_surface.c | 4 |
4 files changed, 21 insertions, 24 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 7f31df6ae5..38609ec88a 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -241,12 +241,12 @@ rasterize_bins( struct setup_context *setup, LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); lp_rast_begin( rast, - setup->fb.cbuf, - setup->fb.zsbuf, - setup->fb.cbuf != NULL, - setup->fb.zsbuf != NULL && write_depth, - setup->fb.width, - setup->fb.height ); + setup->fb->cbufs[0], + setup->fb->zsbuf, + setup->fb->cbufs[0] != NULL, + setup->fb->zsbuf != NULL && write_depth, + setup->fb->width, + setup->fb->height ); /* loop over tile bins, rasterize each */ for (i = 0; i < setup->tiles_x; i++) { @@ -271,7 +271,7 @@ begin_binning( struct setup_context *setup ) { LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); - if (setup->fb.cbuf) { + if (setup->fb->cbufs[0]) { if (setup->clear.flags & PIPE_CLEAR_COLOR) bin_everywhere( setup, lp_rast_clear_color, @@ -280,7 +280,7 @@ begin_binning( struct setup_context *setup ) bin_everywhere( setup, lp_rast_load_color, lp_rast_arg_null() ); } - if (setup->fb.zsbuf) { + if (setup->fb->zsbuf) { if (setup->clear.flags & PIPE_CLEAR_DEPTHSTENCIL) bin_everywhere( setup, lp_rast_clear_zstencil, @@ -355,13 +355,13 @@ lp_setup_flush( struct setup_context *setup, void lp_setup_bind_framebuffer( struct setup_context *setup, - struct pipe_surface *color, - struct pipe_surface *zstencil ) + const struct pipe_framebuffer_state *fb ) { LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); set_state( setup, SETUP_FLUSHED ); +#if 0 pipe_surface_reference( &setup->fb.cbuf, color ); pipe_surface_reference( &setup->fb.zsbuf, zstencil ); @@ -386,9 +386,14 @@ lp_setup_bind_framebuffer( struct setup_context *setup, setup->fb.height = MIN2(setup->fb.cbuf->height, setup->fb.zsbuf->height); } - setup->tiles_x = align(setup->fb.width, TILE_SIZE) / TILE_SIZE; setup->tiles_y = align(setup->fb.height, TILE_SIZE) / TILE_SIZE; +#else + setup->fb = fb; + setup->tiles_x = align(setup->fb->width, TILE_SIZE) / TILE_SIZE; + setup->tiles_y = align(setup->fb->height, TILE_SIZE) / TILE_SIZE; +#endif + } @@ -411,7 +416,7 @@ lp_setup_clear( struct setup_context *setup, if (flags & PIPE_CLEAR_DEPTHSTENCIL) { setup->clear.zstencil.clear_zstencil = - util_pack_z_stencil(setup->fb.zsbuf->format, + util_pack_z_stencil(setup->fb->zsbuf->format, depth, stencil); } diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h b/src/gallium/drivers/llvmpipe/lp_setup.h index 1edd7410fc..66a7f29f1e 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.h +++ b/src/gallium/drivers/llvmpipe/lp_setup.h @@ -53,7 +53,7 @@ struct pipe_surface; struct pipe_buffer; struct pipe_blend_color; struct pipe_screen; -struct setup_context; +struct pipe_framebuffer_state; struct lp_fragment_shader; struct lp_jit_context; @@ -90,8 +90,7 @@ lp_setup_flush( struct setup_context *setup, void lp_setup_bind_framebuffer( struct setup_context *setup, - struct pipe_surface *color, - struct pipe_surface *zstencil ); + const struct pipe_framebuffer_state *fb ); void lp_setup_set_triangle_state( struct setup_context *setup, diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h index 180b8f6e88..dc12eb7847 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_context.h +++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h @@ -79,12 +79,7 @@ struct setup_context { boolean ccw_is_frontface; unsigned cullmode; - struct { - struct pipe_surface *cbuf; - struct pipe_surface *zsbuf; - unsigned width; - unsigned height; - } fb; + const struct pipe_framebuffer_state *fb; struct { unsigned flags; diff --git a/src/gallium/drivers/llvmpipe/lp_state_surface.c b/src/gallium/drivers/llvmpipe/lp_state_surface.c index 909ca9f117..3eff40e3f1 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_surface.c +++ b/src/gallium/drivers/llvmpipe/lp_state_surface.c @@ -83,9 +83,7 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe, } if (dirty) { - lp_setup_bind_framebuffer( lp->setup, - fb->cbufs[0], - fb->zsbuf ); + lp_setup_bind_framebuffer( lp->setup, fb ); lp->dirty |= LP_NEW_FRAMEBUFFER; } |