llvmpipe: use triangle subdivision to avoid fixed-point overflow issues
authorBrian Paul <brianp@vmware.com>
Tue, 26 Mar 2013 04:02:47 +0000 (22:02 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 1 Apr 2013 14:40:35 +0000 (08:40 -0600)
commit1165ff1af1853c9f1156221e1225ed5fb92a4507
treeade105268a8770762a507d38af4f1feed18c8427
parent95df2b28831147b3e7ce2a3b6257bf60c46b4ab4
llvmpipe: use triangle subdivision to avoid fixed-point overflow issues

If we're drawing to a surface that's 2048 x 2048 pixels or larger there's
danger of fixed-point overflow in the triangle rasterization code.  That
leads to various rendering glitches.

Rather than implement some intricate changes to the rasterization code,
simply subdivide triangles into smaller subtriangles to avoid the issue.
Only do this when the drawing surface is larger than 2048 by 2048.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_setup_context.h
src/gallium/drivers/llvmpipe/lp_setup_tri.c