summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-12-09 21:10:39 -0700
committerBrian <[email protected]>2007-12-09 21:10:39 -0700
commit98848382731b71a51e4a80f1820f009e70f06a25 (patch)
tree13d6a08bf46f492ee5266069de248de9642c74b1 /src
parent04e88f469cf6c338ba04640738865b59e160c3d4 (diff)
Fix looping for multi-color buffer writing.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.h2
-rw-r--r--src/mesa/pipe/softpipe/sp_quad.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_blend.c6
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_bufloop.c4
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_colormask.c3
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_output.c3
6 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h
index d4763a98c66..b97cdc52c61 100644
--- a/src/mesa/pipe/softpipe/sp_context.h
+++ b/src/mesa/pipe/softpipe/sp_context.h
@@ -154,7 +154,7 @@ struct softpipe_context {
struct draw_stage *setup;
struct draw_stage *vbuf;
- struct pipe_surface *cbuf; /**< current color buffer (one of cbufs) */
+ uint current_cbuf; /**< current color buffer being written to */
struct softpipe_tile_cache *cbuf_cache[PIPE_MAX_COLOR_BUFS];
struct softpipe_tile_cache *zbuf_cache;
diff --git a/src/mesa/pipe/softpipe/sp_quad.c b/src/mesa/pipe/softpipe/sp_quad.c
index e0327c4cf9c..6330465a8b9 100644
--- a/src/mesa/pipe/softpipe/sp_quad.c
+++ b/src/mesa/pipe/softpipe/sp_quad.c
@@ -77,7 +77,7 @@ sp_build_quad_pipeline(struct softpipe_context *sp)
if (sp->framebuffer.num_cbufs == 1) {
/* the usual case: write to exactly one colorbuf */
- sp->cbuf = sp->framebuffer.cbufs[0];
+ sp->current_cbuf = 0;
}
else {
/* insert bufloop stage */
diff --git a/src/mesa/pipe/softpipe/sp_quad_blend.c b/src/mesa/pipe/softpipe/sp_quad_blend.c
index 696e252af17..76a0873fc5e 100644
--- a/src/mesa/pipe/softpipe/sp_quad_blend.c
+++ b/src/mesa/pipe/softpipe/sp_quad_blend.c
@@ -107,7 +107,8 @@ logicop_quad(struct quad_stage *qs, struct quad_header *quad)
uint *dst4 = (uint *) dst;
uint *res4 = (uint *) res;
struct softpipe_cached_tile *
- tile = sp_get_cached_tile(softpipe, softpipe->cbuf_cache[0],
+ tile = sp_get_cached_tile(softpipe,
+ softpipe->cbuf_cache[softpipe->current_cbuf],
quad->x0, quad->y0);
uint i, j;
@@ -224,7 +225,8 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
static const float one[4] = { 1, 1, 1, 1 };
float source[4][QUAD_SIZE], dest[4][QUAD_SIZE];
struct softpipe_cached_tile *tile
- = sp_get_cached_tile(softpipe, softpipe->cbuf_cache[0],
+ = sp_get_cached_tile(softpipe,
+ softpipe->cbuf_cache[softpipe->current_cbuf],
quad->x0, quad->y0);
uint i, j;
diff --git a/src/mesa/pipe/softpipe/sp_quad_bufloop.c b/src/mesa/pipe/softpipe/sp_quad_bufloop.c
index aac70e2b04e..e704b4043cf 100644
--- a/src/mesa/pipe/softpipe/sp_quad_bufloop.c
+++ b/src/mesa/pipe/softpipe/sp_quad_bufloop.c
@@ -30,7 +30,7 @@ cbuf_loop_quad(struct quad_stage *qs, struct quad_header *quad)
for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) {
/* set current cbuffer */
- softpipe->cbuf = softpipe->framebuffer.cbufs[i];
+ softpipe->current_cbuf = i;
/* pass blended quad to next stage */
qs->next->run(qs->next, quad);
@@ -38,8 +38,6 @@ cbuf_loop_quad(struct quad_stage *qs, struct quad_header *quad)
/* restore quad's colors for next buffer */
memcpy(quad->outputs.color, tmp, sizeof(tmp));
}
-
- softpipe->cbuf = NULL; /* prevent accidental use */
}
diff --git a/src/mesa/pipe/softpipe/sp_quad_colormask.c b/src/mesa/pipe/softpipe/sp_quad_colormask.c
index c585aa3eddd..f5e0a32d1b7 100644
--- a/src/mesa/pipe/softpipe/sp_quad_colormask.c
+++ b/src/mesa/pipe/softpipe/sp_quad_colormask.c
@@ -50,7 +50,8 @@ colormask_quad(struct quad_stage *qs, struct quad_header *quad)
float dest[4][QUAD_SIZE];
struct softpipe_cached_tile *tile
= sp_get_cached_tile(softpipe,
- softpipe->cbuf_cache[0], quad->x0, quad->y0);
+ softpipe->cbuf_cache[softpipe->current_cbuf],
+ quad->x0, quad->y0);
uint i, j;
/* get/swizzle dest colors */
diff --git a/src/mesa/pipe/softpipe/sp_quad_output.c b/src/mesa/pipe/softpipe/sp_quad_output.c
index cebfec18f74..f04a550e3df 100644
--- a/src/mesa/pipe/softpipe/sp_quad_output.c
+++ b/src/mesa/pipe/softpipe/sp_quad_output.c
@@ -43,7 +43,8 @@ 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[0],
+ = 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;