aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2016-11-13 17:17:25 +0100
committerRoland Scheidegger <[email protected]>2016-11-21 20:02:53 +0100
commit78a997f72841310620d18daa9015633343d04db1 (patch)
tree8e5eeddc4f749ac58e69b529d51637869b35298f /src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h
parent7a55c436c64a8bb031c8823522cde8f3adc67d89 (diff)
draw: drop unnecessary index overflow handling from vsplit code
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... Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h b/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h
index 7b0897018c1..be353c418d8 100644
--- a/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h
+++ b/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h
@@ -156,7 +156,7 @@ CONCAT(vsplit_segment_cache_, ELT_TYPE)(struct vsplit_frontend *vsplit,
if (close)
ADD_CACHE(vsplit, ib, 0, iclose, 0);
}
- else if (ibias > 0) {
+ else {
if (spoken)
ADD_CACHE(vsplit, ib, 0, ispoken, ibias);
@@ -166,19 +166,6 @@ CONCAT(vsplit_segment_cache_, ELT_TYPE)(struct vsplit_frontend *vsplit,
if (close)
ADD_CACHE(vsplit, ib, 0, iclose, ibias);
}
- else {
- if (spoken) {
- ADD_CACHE(vsplit, ib, 0, ispoken, ibias);
- }
-
- for (i = spoken; i < icount; i++) {
- ADD_CACHE(vsplit, ib, istart, i, ibias);
- }
-
- if (close) {
- ADD_CACHE(vsplit, ib, 0, iclose, ibias);
- }
- }
vsplit_flush_cache(vsplit, flags);
}