summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_quad_blend.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-08-18 12:57:16 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:34 +0100
commit3014919211b361817c5365f7cbb8d2ef8ca61234 (patch)
treea192d357bff387f2369633831c8b7d75f33659e9 /src/gallium/drivers/llvmpipe/lp_quad_blend.c
parentefab431684bb17459073f6a2e96044cb2ebd2524 (diff)
llvmpipe: Rasterize the quads according to what the blend function expects.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_quad_blend.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_quad_blend.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_quad_blend.c b/src/gallium/drivers/llvmpipe/lp_quad_blend.c
index 4312753eef..976994f4e8 100644
--- a/src/gallium/drivers/llvmpipe/lp_quad_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_quad_blend.c
@@ -144,12 +144,17 @@ blend_run(struct quad_stage *qs,
for (cbuf = 0; cbuf < llvmpipe->framebuffer.nr_cbufs; cbuf++)
{
+ unsigned x0 = quads[0]->input.x0;
+ unsigned y0 = quads[0]->input.y0;
uint8_t ALIGN16_ATTRIB src[4][16];
uint8_t ALIGN16_ATTRIB dst[4][16];
struct llvmpipe_cached_tile *tile
- = lp_get_cached_tile(llvmpipe->cbuf_cache[cbuf],
- quads[0]->input.x0,
- quads[0]->input.y0);
+ = lp_get_cached_tile(llvmpipe->cbuf_cache[cbuf], x0, y0);
+
+ assert(nr * QUAD_SIZE == TILE_VECTOR_HEIGHT * TILE_VECTOR_WIDTH);
+
+ assert(x0 % TILE_VECTOR_WIDTH == 0);
+ assert(y0 % TILE_VECTOR_HEIGHT == 0);
for (q = 0; q < nr; q += 4) {
for (k = 0; k < 4 && q + k < nr; ++k) {
@@ -193,6 +198,8 @@ blend_run(struct quad_stage *qs,
if (quad->inout.mask & (1 << j)) {
int x = itx + (j & 1);
int y = ity + (j >> 1);
+ assert(x < TILE_SIZE);
+ assert(y < TILE_SIZE);
for (i = 0; i < 4; i++) { /* loop over color chans */
TILE_PIXEL(tile->data.color, x, y, i) = src[i][4*k + j];
}