draw/gs: make sure geometry shaders don't overflow
authorZack Rusin <zackr@vmware.com>
Wed, 17 Apr 2013 03:31:22 +0000 (20:31 -0700)
committerZack Rusin <zackr@vmware.com>
Wed, 17 Apr 2013 06:38:47 +0000 (23:38 -0700)
commitf01f754ca13373d62f5f4ba5ff76d83aa4eac62b
treeaf3c40e5cebfeb05e40efd447b6af18a035653fb
parentbe497ac9d3b5c50a4cd126578081bd54b68f16a9
draw/gs: make sure geometry shaders don't overflow

The specification says that the geometry shader should exit if the
number of emitted vertices is bigger or equal to max_output_vertices and
we can't do that because we're running in the SoA mode, which means that
our storing routines will keep getting called on channels that have
overflown (even though they will be masked out, but we just can't skip
them).
So we need some scratch area where we can keep writing the overflown
vertices without overwriting anything important or crashing.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_gs.c
src/gallium/auxiliary/draw/draw_gs.h
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c