st/mesa: only set primitive_restart when the restart index is in range
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 19 Oct 2016 16:14:48 +0000 (18:14 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 20 Oct 2016 08:37:06 +0000 (10:37 +0200)
commitbfa50f88cea2ba9f4dc4b825828d2c8f02866fc3
tree4e61034d4d16af50c5d67cc5237f696730fa1766
parent3d9b57e49304f9690c4a2b50afb8cdd4d253a1df
st/mesa: only set primitive_restart when the restart index is in range

Even when enabled, primitive restart has no effect when the restart index
is larger than the representable values in the index buffer.

Fixes GL45-CTS.gtf31.GL3Tests.primitive_restart.primitive_restart_upconvert
for radeonsi VI.

v2: add an explanatory comment

Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
src/mesa/state_tracker/st_draw.c