summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-10-09 16:19:00 +0100
committerKeith Whitwell <keithw@vmware.com>2009-10-09 16:20:56 +0100
commit05131f7502150968d7ee19673676f74d4c2fd22b (patch)
treed9bee2ea56611f01b6c3db8d1110a0f8acaf9daa /src
parentc2e926b72de21bfac0048f32e1204537446d5ab0 (diff)
llvmpipe: properly clip tile writes
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index e73331535f..3585011ace 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -269,15 +269,23 @@ static void lp_rast_store_color( struct lp_rasterizer *rast )
{
const unsigned x = rast->x;
const unsigned y = rast->y;
+ unsigned w = TILESIZE;
+ unsigned h = TILESIZE;
- RAST_DEBUG("%s %d,%d\n", __FUNCTION__, x, y);
+ if (x + w > rast->width)
+ w -= x + w - rast->width;
+
+ if (y + h > rast->height)
+ h -= y + h - rast->height;
+
+ RAST_DEBUG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
lp_tile_write_4ub(rast->cbuf_transfer->format,
rast->tile.color,
rast->cbuf_map,
rast->cbuf_transfer->stride,
x, y,
- TILESIZE, TILESIZE);
+ w, h);
}