diff options
author | Roland Scheidegger <[email protected]> | 2016-11-12 22:47:22 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2016-11-21 20:02:53 +0100 |
commit | 7a55c436c64a8bb031c8823522cde8f3adc67d89 (patch) | |
tree | bcbd9bc3e93efa9aedd2ab4c48cb563f7c41eac8 /VERSION | |
parent | 9aae167e9474b7c220cbc3f172a27c0b6bf9b20a (diff) |
draw: simplify vsplit elts code a bit
vsplit_get_base_idx explicitly returned idx 0 and set the ofbit
in case of overflow. We'd then check the ofbit and use idx 0 instead of
looking it up. This was necessary because DRAW_GET_IDX used to return
DRAW_MAX_FETCH_IDX and not 0 in case of overflows.
However, this is all unnecessary, we can just let DRAW_GET_IDX return 0
in case of overflow. In fact before bbd1e60198548a12be3405fc32dd39a87e8968ab
the code already did that, not sure why this particular bit was changed
(might have been one half of an attempt to get these indices to actual draw
shader execution - in fact I think this would make things less awkward, it
would require moving the eltBias handling to the shader as well).
Note there's other callers of DRAW_GET_IDX - those code paths however
explicitly do not handle index buffer overflows, therefore the overflow
value doesn't matter for them.
Also do some trivial simplification - for (unsigned) a + b, checking res < a
is sufficient for overflow detection, we don't need to check for res < b too
(similar for signed).
And an index buffer overflow check looked bogus - eltMax is the number of
elements in the index buffer, not the maximum element which can be fetched.
(Drop the start check against the idx buffer though, this is already covered
by end check and end < start).
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'VERSION')
0 files changed, 0 insertions, 0 deletions