[deqp] Fix wrong firstIndex for non-instanced draws with nonzero divisor
bug: 34245909
If the vertex attribute divisor is nonzero,
that actually affects first index for non-instanced draws
at least.
TODO: Figure out if this affects the instanced draws too.
dEQP-GLES3.functional.draw.random.210 : Fail -> Pass
Change-Id: Ida45d4689e0418ad8679091556a9fcaa64bbe25e
diff --git a/system/GLESv2_enc/GL2Encoder.cpp b/system/GLESv2_enc/GL2Encoder.cpp
index 14c5ac1..daa972f 100755
--- a/system/GLESv2_enc/GL2Encoder.cpp
+++ b/system/GLESv2_enc/GL2Encoder.cpp
@@ -940,7 +940,14 @@
int stride = curr_binding.stride;
int effectiveStride = curr_binding.effectiveStride;
uintptr_t offset = curr_binding.offset;
+
int firstIndex = effectiveStride * first;
+ if (firstIndex && divisor && !primcount) {
+ // If firstIndex != 0 according to effectiveStride * first,
+ // it needs to be adjusted if a divisor has been specified,
+ // even if we are not in glDraw***Instanced.
+ firstIndex = 0;
+ }
if (bufferObject == 0) {
unsigned int datalen = state.elementSize * count;