diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-06-19 19:19:31 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-06-19 19:19:31 -0600 |
commit | af9b5ca0359b5712509d7815a7fbc81a3255f4af (patch) | |
tree | a9669c33d78e42d7925f60afd6e54037c39de2ac /src/mesa/pipe/softpipe/sp_tile_output.c | |
parent | 03933ad656e5bd776a2e6f93312ee90eff66d3d3 (diff) |
Re-org of surface/framebuffer state.
We should be able to render to any depth/format of X window now.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_tile_output.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_tile_output.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/src/mesa/pipe/softpipe/sp_tile_output.c b/src/mesa/pipe/softpipe/sp_tile_output.c index b1eb9e8c9f..d4add4b162 100644 --- a/src/mesa/pipe/softpipe/sp_tile_output.c +++ b/src/mesa/pipe/softpipe/sp_tile_output.c @@ -55,38 +55,35 @@ static void mask_copy( GLfloat (*dest)[4], } -/* Write to the output, taking mask into account. +/** + * Write quad to framebuffer, taking mask into account. * * Note that surfaces support only full quad reads and writes. */ void quad_output( struct softpipe_context *softpipe, struct quad_header *quad ) { + GLuint i; - if (quad->mask != MASK_ALL) - { - GLfloat tmp[4][QUAD_SIZE]; + for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) { + struct softpipe_surface *sps + = (struct softpipe_surface *) softpipe->framebuffer.cbufs[i]; - /* Yes, we'll probably have a masked write as well, but this is - * how blend will be done at least. - */ - gs_read_quad_f_swz( softpipe->cbuf_surface, - quad->x0, - quad->y0, - tmp ); - - mask_copy( tmp, quad->outputs.color, quad->mask ); + if (quad->mask != MASK_ALL) { + GLfloat tmp[4][QUAD_SIZE]; - gs_write_quad_f_swz( softpipe->cbuf_surface, - quad->x0, - quad->y0, - tmp ); - } - else - { - gs_write_quad_f_swz( softpipe->cbuf_surface, - quad->x0, - quad->y0, - quad->outputs.color ); + /* Yes, we'll probably have a masked write as well, but this is + * how blend will be done at least. + */ + + sps->read_quad_f_swz(sps, quad->x0, quad->y0, tmp); + + mask_copy( tmp, quad->outputs.color, quad->mask ); + + sps->write_quad_f_swz(sps, quad->x0, quad->y0, tmp); + } + else { + sps->write_quad_f_swz(sps, quad->x0, quad->y0, quad->outputs.color); + } } } |