Fix DrawRangeElementsBaseVertex tests with negative basevertex
authorAlexander Galazin <alexander.galazin@arm.com>
Tue, 9 May 2017 08:44:12 +0000 (10:44 +0200)
committerMika Isojärvi <misojarvi@google.com>
Thu, 6 Jul 2017 19:16:05 +0000 (12:16 -0700)
commitbf0b29365e9aa156370549e8af99e272e129296e
treef7403f9540219f52abf6a87facaa6784da668ec7
parent3c865084eb27036bf9fd43a41a7eae277a6ee170
Fix DrawRangeElementsBaseVertex tests with negative basevertex

DrawRangeElementsBaseVertex tests with negative basevertex call
glDrawRangeElementsBaseVertex with start = 0 and basevertex = -1.
According to the spec: If no element array buffer is bound, the vertex ID of
the ith element transferred is indices[i] + basevertex...
If the vertex ID is larger than the maximum value representable by type,
it should behave as if the calculation were upconverted to 32-bit unsigned
integers (with wrapping on overflow conditions).
Behavior of DrawElementsOneInstance is undefined if the vertex ID is negative
for any element, and should be handled as described in section 6.4.

This change ensures that indexMin + baseVertex will be zero or positive value.

Components: AOSP

Affects:
dEQP-GLES31.functional.draw_base_vertex.draw_range_elements_base_vertex.base_vertex.index_neg_byte
dEQP-GLES31.functional.draw_base_vertex.draw_range_elements_base_vertex.base_vertex.index_neg_short
dEQP-GLES31.functional.draw_base_vertex.draw_range_elements_base_vertex.base_vertex.index_neg_int

Change-Id: I07a9e6bc60d4340784d400b5087bb8fff01f0e57
modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp