summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_quad_colormask.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_colormask.c
parent4e2127b0e5cb6411123e16dd562626cd70814a9a (diff)
gallium: begin reworking quad stages for multiple color outputs
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_quad_colormask.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_colormask.c59
1 files changed, 32 insertions, 27 deletions
diff --git a/src/gallium/drivers/softpipe/sp_quad_colormask.c b/src/gallium/drivers/softpipe/sp_quad_colormask.c
index 1f09d900ca..7fe080990b 100644
--- a/src/gallium/drivers/softpipe/sp_quad_colormask.c
+++ b/src/gallium/drivers/softpipe/sp_quad_colormask.c
@@ -47,38 +47,43 @@ static void
colormask_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
- float dest[4][QUAD_SIZE];
- struct softpipe_cached_tile *tile
- = sp_get_cached_tile(softpipe,
- softpipe->cbuf_cache[softpipe->current_cbuf],
- quad->x0, quad->y0);
- float (*quadColor)[4] = quad->outputs.color;
- uint i, j;
-
- /* get/swizzle dest colors */
- for (j = 0; j < QUAD_SIZE; j++) {
- int x = (quad->x0 & (TILE_SIZE-1)) + (j & 1);
- int y = (quad->y0 & (TILE_SIZE-1)) + (j >> 1);
- for (i = 0; i < 4; i++) {
- dest[i][j] = tile->data.color[y][x][i];
+ uint cbuf;
+
+ /* loop over colorbuffer outputs */
+ for (cbuf = 0; cbuf < softpipe->framebuffer.num_cbufs; cbuf++) {
+ float dest[4][QUAD_SIZE];
+ 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];
+ uint i, j;
+
+ /* get/swizzle dest colors */
+ for (j = 0; j < QUAD_SIZE; j++) {
+ int x = (quad->x0 & (TILE_SIZE-1)) + (j & 1);
+ int y = (quad->y0 & (TILE_SIZE-1)) + (j >> 1);
+ for (i = 0; i < 4; i++) {
+ dest[i][j] = tile->data.color[y][x][i];
+ }
}
- }
- /* R */
- if (!(softpipe->blend->colormask & PIPE_MASK_R))
- COPY_4V(quadColor[0], dest[0]);
+ /* R */
+ if (!(softpipe->blend->colormask & PIPE_MASK_R))
+ COPY_4V(quadColor[0], dest[0]);
- /* G */
- if (!(softpipe->blend->colormask & PIPE_MASK_G))
- COPY_4V(quadColor[1], dest[1]);
+ /* G */
+ if (!(softpipe->blend->colormask & PIPE_MASK_G))
+ COPY_4V(quadColor[1], dest[1]);
- /* B */
- if (!(softpipe->blend->colormask & PIPE_MASK_B))
- COPY_4V(quadColor[2], dest[2]);
+ /* B */
+ if (!(softpipe->blend->colormask & PIPE_MASK_B))
+ COPY_4V(quadColor[2], dest[2]);
- /* A */
- if (!(softpipe->blend->colormask & PIPE_MASK_A))
- COPY_4V(quadColor[3], dest[3]);
+ /* A */
+ if (!(softpipe->blend->colormask & PIPE_MASK_A))
+ COPY_4V(quadColor[3], dest[3]);
+ }
/* pass quad to next stage */
qs->next->run(qs->next, quad);