draw: drop unnecessary index overflow handling from vsplit code

Graphics / Mesa 3D Graphics Library / Mesa - Roland Scheidegger [vmware.com] - 21 November 2016 13:02 UTC

This was kind of strange, since it replaced indices which were only overflowing due to bias with MAX_UINT. This would cause an overflow later in the shader, except if stride was 0, however the vertex id would be essentially random then (-1 + eltBias). No test cared about it, though. So, drop this and just use ordinary int arithmetic wraparound as usual. This is much simpler to understand and the results are "more correct" or at least more consistent (vertex id as well as actual fetch results just correspond to wrapped around arithmetic). There's only one catch, it is now possible to hit the cache initialization
value also with ushort and ubyte elts path (this wouldn't be an issue if we'd simply handle the eltBias itself later in the shader). Hence, we need to make sure the cache logic doesn't think this element has already been emitted when it has not (I believe some seriously bad things could happen otherwise). So, borrow the logic which handled this from the uint case, but not before fixing it up...

78a997f draw: drop unnecessary index overflow handling from vsplit code
src/gallium/auxiliary/draw/draw_pt_vsplit.c | 69 +++++++++--------------
src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h | 15 +----
2 files changed, 28 insertions(+), 56 deletions(-)

Upstream: cgit.freedesktop.org


  • Share