summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe/sp_tile_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_tile_output.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_output.c45
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);
+ }
}
}