summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_quad_output.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-04-07 21:59:12 -0600
committerBrian <brian.paul@tungstengraphics.com>2008-04-07 21:59:12 -0600
commitc7daa68ca312cc98abe351be2fef8d8246929627 (patch)
treeafb31b40a34da809654bd7cef860d9f486fc1c9f /src/gallium/drivers/softpipe/sp_quad_output.c
parent4e2127b0e5cb6411123e16dd562626cd70814a9a (diff)
gallium: begin reworking quad stages for multiple color outputs
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_quad_output.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_output.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/gallium/drivers/softpipe/sp_quad_output.c b/src/gallium/drivers/softpipe/sp_quad_output.c
index cfe8f11808..40083138a4 100644
--- a/src/gallium/drivers/softpipe/sp_quad_output.c
+++ b/src/gallium/drivers/softpipe/sp_quad_output.c
@@ -34,31 +34,36 @@
/**
- * Write quad to framebuffer, taking mask into account.
- *
- * Note that surfaces support only full quad reads and writes.
+ * Last step of quad processing: write quad colors to the framebuffer,
+ * taking mask into account.
*/
static void
output_quad(struct quad_stage *qs, struct quad_header *quad)
{
- struct softpipe_context *softpipe = qs->softpipe;
- struct softpipe_cached_tile *tile
- = sp_get_cached_tile(softpipe,
- softpipe->cbuf_cache[softpipe->current_cbuf],
- quad->x0, quad->y0);
/* in-tile pos: */
const int itx = quad->x0 % TILE_SIZE;
const int ity = quad->y0 % TILE_SIZE;
- float (*quadColor)[4] = quad->outputs.color;
- int i, j;
- /* get/swizzle dest colors */
- for (j = 0; j < QUAD_SIZE; j++) {
- if (quad->mask & (1 << j)) {
- int x = itx + (j & 1);
- int y = ity + (j >> 1);
- for (i = 0; i < 4; i++) { /* loop over color chans */
- tile->data.color[y][x][i] = quadColor[i][j];
+ struct softpipe_context *softpipe = qs->softpipe;
+ uint cbuf;
+
+ /* loop over colorbuffer outputs */
+ for (cbuf = 0; cbuf < softpipe->framebuffer.num_cbufs; cbuf++) {
+ struct softpipe_cached_tile *tile
+ = sp_get_cached_tile(softpipe,
+ softpipe->cbuf_cache[cbuf],
+ quad->x0, quad->y0);
+ float (*quadColor)[4] = quad->outputs.color[cbuf];
+ int i, j;
+
+ /* get/swizzle dest colors */
+ for (j = 0; j < QUAD_SIZE; j++) {
+ if (quad->mask & (1 << j)) {
+ int x = itx + (j & 1);
+ int y = ity + (j >> 1);
+ for (i = 0; i < 4; i++) { /* loop over color chans */
+ tile->data.color[y][x][i] = quadColor[i][j];
+ }
}
}
}