draw: try to prevent overflows on index buffers 99/6599/1
authorZack Rusin <zackr@vmware.com>
Tue, 14 May 2013 03:07:14 +0000 (23:07 -0400)
committerZack Rusin <zackr@vmware.com>
Tue, 14 May 2013 07:10:56 +0000 (03:10 -0400)
commit5104ed3dbf18d47736fc67a8e3e317ea18360fa8
treed161f1e6f09b3ab6846b064105b8cfc014b203cc
parentd5250da8189d0fb9741049cdbfc50e84aab44ecb
draw: try to prevent overflows on index buffers

Pass in the size of the index buffer, when available, and use it
to handle out of bounds conditions. The behavior in the case of
an overflow needs to be the same as with other overflows in the
vertex processing pipeline meaning that a vertex should still
be generated but all attributes in it set to zero.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
15 files changed:
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_context.h
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_llvm.h
src/gallium/auxiliary/draw/draw_private.h
src/gallium/auxiliary/draw/draw_pt.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h
src/gallium/drivers/i915/i915_context.c
src/gallium/drivers/llvmpipe/lp_draw_arrays.c
src/gallium/drivers/nv30/nv30_draw.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/softpipe/sp_draw_arrays.c
src/gallium/drivers/svga/svga_swtnl_draw.c
src/mesa/state_tracker/st_draw_feedback.c