i830: Compute initial number of vertices from remaining batch space
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 9 Nov 2011 22:21:16 +0000 (22:21 +0000)
committerEric Anholt <eric@anholt.net>
Sat, 3 Mar 2012 01:16:12 +0000 (17:16 -0800)
commit33b07893e92dcee495908c549be872887096c894
tree88bbfe50cdaff1df854ad278cf543e19ee0a52b3
parent7d13a6e64bf88566875a8f68e0aac9b937e30feb
i830: Compute initial number of vertices from remaining batch space

In order to prevent an overflow of the batch buffer when emitting
triangles, we need to limit the initial primitive to fit within the
current batch. To do we need to measure the remaining space and thence
compute the maximum number of vertices that fit into that space.

Reported-by: Kurt Roeckx <kurt@roeckx.be>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
src/mesa/drivers/dri/i915/intel_render.c