From: José Fonseca Date: Fri, 9 Oct 2009 09:37:24 +0000 (+0100) Subject: llvmpipe: Follow write_color/write_zstencil. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=47510040a68f5f672aee22eac6c01fb4dd60ec67;p=mesa.git llvmpipe: Follow write_color/write_zstencil. --- diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 6ac44feb4c7..9825099c945 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -64,6 +64,7 @@ void lp_rast_bind_color( struct lp_rasterizer *rast, boolean write_color ) { pipe_surface_reference(&rast->state.cbuf, cbuf); + rast->state.write_color = write_color; } void lp_rast_bind_zstencil( struct lp_rasterizer *rast, @@ -71,6 +72,7 @@ void lp_rast_bind_zstencil( struct lp_rasterizer *rast, boolean write_zstencil ) { pipe_surface_reference(&rast->state.zsbuf, zsbuf); + rast->state.write_zstencil = write_zstencil; } @@ -206,7 +208,7 @@ void lp_rast_shade_quads( struct lp_rasterizer *rast, */ -void lp_rast_end_tile( struct lp_rasterizer *rast ) +static void lp_rast_store_color( struct lp_rasterizer *rast ) { struct pipe_surface *surface; struct pipe_screen *screen; @@ -250,11 +252,25 @@ void lp_rast_end_tile( struct lp_rasterizer *rast ) screen->tex_transfer_destroy(transfer); - if (0) { - /* FIXME: call u_tile func to store depth/stencil to surface */ - } } + +static void lp_rast_store_zstencil( struct lp_rasterizer *rast ) +{ + /* FIXME: call u_tile func to store depth/stencil to surface */ +} + + +void lp_rast_end_tile( struct lp_rasterizer *rast ) +{ + if (rast->state.write_color) + lp_rast_store_color(rast); + + if (rast->state.write_zstencil) + lp_rast_store_zstencil(rast); +} + + /* Shutdown: */ void lp_rast_destroy( struct lp_rasterizer *rast ) diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h index 26d057beb29..aa50fba5a60 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.h +++ b/src/gallium/drivers/llvmpipe/lp_rast.h @@ -163,12 +163,6 @@ void lp_rast_shade_tile( struct lp_rasterizer *, const union lp_rast_cmd_arg *, const struct lp_rast_shader_inputs *); -void lp_rast_store_color( struct lp_rasterizer *, - const union lp_rast_cmd_arg *); - -void lp_rast_store_zstencil( struct lp_rasterizer *, - const union lp_rast_cmd_arg *); - /* End of tile: */ diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h index d7a8b9c257d..f5a6699ed42 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h @@ -61,6 +61,8 @@ struct lp_rasterizer { struct { struct pipe_surface *cbuf; struct pipe_surface *zsbuf; + boolean write_color; + boolean write_zstencil; unsigned clear_color; unsigned clear_depth; char clear_stencil;