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;
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 */
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;
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;
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);
/* restore quad's colors for next buffer */
memcpy(quad->outputs.color, tmp, sizeof(tmp));
}
-
- softpipe->cbuf = NULL; /* prevent accidental use */
}
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 */
{
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;