gallium/auxiliary: Handle count == 0 in u_vbuf_get_minmax_index_mapped
authorIcecream95 <ixn@keemail.me>
Wed, 11 Dec 2019 08:08:41 +0000 (21:08 +1300)
committerMarge Bot <eric+marge@anholt.net>
Mon, 16 Dec 2019 22:57:35 +0000 (22:57 +0000)
commit37bc02836706a946eb7854a11c624ce1689496ea
treef9eb8828b164224ef87cdcdaa7208ab9fcbbf2dc
parent80aca96803a37a7436ff96c0cec4a2643f11ed05
gallium/auxiliary: Handle count == 0 in u_vbuf_get_minmax_index_mapped

This makes u_vbuf_get_minmax_index_mapped return min = 0 / max = 0
when info->count == 0.

That should never happen anyway, but this commit makes it at least
return a sane value that callers expect, and also allows us - and
GCC - to assume count != 0 for optimization purposes.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3050>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3050>
src/gallium/auxiliary/util/u_vbuf.c