diff options
author | José Fonseca <jfonseca@vmware.com> | 2011-10-05 11:31:15 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2011-10-05 18:07:05 +0100 |
commit | c620087432b2055aa9301f19f8b6444080698c90 (patch) | |
tree | 7950a03f39959a41913dded80267a19b0e316faa /src/gallium/drivers/llvmpipe/lp_rast_priv.h | |
parent | 9c697a9d004da4aa7a26d3bda17cc473f50345ea (diff) | |
download | external_mesa3d-c620087432b2055aa9301f19f8b6444080698c90.zip external_mesa3d-c620087432b2055aa9301f19f8b6444080698c90.tar.gz external_mesa3d-c620087432b2055aa9301f19f8b6444080698c90.tar.bz2 |
llvmpipe: Ensure the 16x16 special rasterization path does not touch outside the tile.
llvmpipe has a few special rasterization paths for triangles contained in
16x16 blocks, but it allows the 16x16 block to be aligned only to a 4x4
grid.
Some 16x16 blocks could actually intersect the tile
if the triangle is 16 pixels in one dimension but 4 in the other, causing
a buffer overflow.
The fix consists of budging the 16x16 blocks back inside the tile.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast_priv.h')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast_priv.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h index cd686bc..d0bda35 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h @@ -151,6 +151,8 @@ lp_rast_get_depth_block_pointer(struct lp_rasterizer_task *task, const struct lp_scene *scene = task->scene; void *depth; + assert(x < scene->tiles_x * TILE_SIZE); + assert(y < scene->tiles_y * TILE_SIZE); assert((x % TILE_VECTOR_WIDTH) == 0); assert((y % TILE_VECTOR_HEIGHT) == 0); @@ -181,6 +183,8 @@ lp_rast_get_color_tile_pointer(struct lp_rasterizer_task *task, { const struct lp_scene *scene = task->scene; + assert(task->x < scene->tiles_x * TILE_SIZE); + assert(task->y < scene->tiles_y * TILE_SIZE); assert(task->x % TILE_SIZE == 0); assert(task->y % TILE_SIZE == 0); assert(buf < scene->fb.nr_cbufs); @@ -219,6 +223,8 @@ lp_rast_get_color_block_pointer(struct lp_rasterizer_task *task, unsigned px, py, pixel_offset; uint8_t *color; + assert(x < task->scene->tiles_x * TILE_SIZE); + assert(y < task->scene->tiles_y * TILE_SIZE); assert((x % TILE_VECTOR_WIDTH) == 0); assert((y % TILE_VECTOR_HEIGHT) == 0); |