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
diff --git a/modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp b/modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp
index 21ef2b9..11764c1 100644
--- a/modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp
+++ b/modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp
@@ -573,6 +573,12 @@
 		{
 			const std::string iterationDesc = std::string("base vertex ") + de::toString(indexTest.baseVertex[iterationNdx]);
 			spec.baseVertex	= indexTest.baseVertex[iterationNdx];
+			// spec.indexMin + spec.baseVertex can not be a negative value
+			if (spec.indexMin + spec.baseVertex < 0)
+			{
+				spec.indexMax -= (spec.indexMin + spec.baseVertex);
+				spec.indexMin -= (spec.indexMin + spec.baseVertex);
+			}
 			test->addIteration(spec, iterationDesc.c_str());
 		}