OSDN Git Service

u_primconvert: Copy min/max_index from the original primitive.
authorEric Anholt <eric@anholt.net>
Tue, 5 Aug 2014 18:29:07 +0000 (11:29 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 9 Aug 2014 01:59:47 +0000 (18:59 -0700)
commit961715eab2117772e0145229d6f934d351b9b27b
tree092d1343f153d8764ad4c246ca3e768469c27bed
parent1d03692f7888929c44446633809fe7bbc9da5d73
u_primconvert: Copy min/max_index from the original primitive.

These values are supposed to be the minimum/maximum index values used to
read from the vertex buffers.  This code either copies index values out of
the old IB (so, same min/max as the original draw call), or generates a
new IB (using index values between the start and the start + count of the
old array draw info, which just happens to be what min/max_index are set
to by st_draw.c).

We were incorrectly setting the max_index in the
converting-from-glDrawArrays case to the start vertex plus the number of
vertices generated in the new IB, which broke QUADS primitive conversion
on VC4 (where max_index really has to be correct, or the kernel might
reject your draw call due to buffer overflow).

Reviewed-by: Rob Clark <robclark@freedesktop.org> (from verbal description
             of the patch)
src/gallium/auxiliary/indices/u_primconvert.c