u_prim_restart: Fix index scanning with start offset

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13681>
This commit is contained in:
Jesse Natalie 2021-11-04 09:45:12 -07:00 committed by Marge Bot
parent bc345281ab
commit b34fed64fa

View file

@ -239,7 +239,7 @@ util_prim_restart_convert_to_direct(const void *index_map,
#define SCAN_INDEXES(TYPE) \ #define SCAN_INDEXES(TYPE) \
for (i = 0; i <= draw->count; i++) { \ for (i = 0; i <= draw->count; i++) { \
if (i == draw->count || \ if (i == draw->count || \
((const TYPE *) index_map)[i] == info->restart_index) { \ ((const TYPE *) index_map)[draw->start + i] == info->restart_index) { \
/* cut / restart */ \ /* cut / restart */ \
if (count > 0) { \ if (count > 0) { \
if (!add_range(info->mode, &ranges, draw->start + start, count, draw->index_bias)) { \ if (!add_range(info->mode, &ranges, draw->start + start, count, draw->index_bias)) { \