swr: fix index buffers with non-zero indices
authorGeorge Kyriazis <george.kyriazis@intel.com>
Fri, 3 Feb 2017 03:16:47 +0000 (21:16 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Thu, 23 Feb 2017 22:36:18 +0000 (16:36 -0600)
commitdcac48bfee545660dffbf23bd92a0939b19ffd18
treeed9da084c5b41ca162190a3bf511e7c294f8397f
parent669d8f626f64cee1bc74ef7869aac8585b6dcfe6
swr: fix index buffers with non-zero indices

Fix issue with index buffers that do not contain a 0 index.  0 index
can be a non-valid index if the (copied) vertex buffers are a subset of the
user's (which happens because we only copy the range between min & max).
Core will use an index passed in from the driver to replace invalid indices.

Only do this for calls that contain non-zero indices, to minimize performance

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
cost.
src/gallium/drivers/swr/rasterizer/core/state.h
src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.h
src/gallium/drivers/swr/swr_draw.cpp
src/gallium/drivers/swr/swr_state.cpp