summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_tri.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 5197dca8f9..9248125de8 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -389,6 +389,11 @@ do_triangle_ccw(struct setup_context *setup,
maxx = tri->maxx / TILE_SIZE;
maxy = tri->maxy / TILE_SIZE;
+ /* Clamp maxx, maxy to framebuffer size
+ */
+ maxx = MIN2(maxx, scene->tiles_x - 1);
+ maxy = MIN2(maxy, scene->tiles_y - 1);
+
/* Determine which tile(s) intersect the triangle's bounding box
*/
if (miny == maxy && minx == maxx)