OSDN Git Service

[deqp] Fix wrong firstIndex for non-instanced draws with nonzero divisor
authorLingfeng Yang <lfy@google.com>
Wed, 15 Feb 2017 16:44:21 +0000 (08:44 -0800)
committerLingfeng Yang <lfy@google.com>
Wed, 15 Feb 2017 16:59:48 +0000 (08:59 -0800)
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

system/GLESv2_enc/GL2Encoder.cpp

index 14c5ac1..daa972f 100755 (executable)
@@ -940,7 +940,14 @@ void GL2Encoder::sendVertexAttributes(GLint first, GLsizei count, bool hasClient
             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;