Fix GLES31 format counts in draw buffers indexed tests
authorMika Isojärvi <misojarvi@google.com>
Mon, 21 Mar 2016 17:12:16 +0000 (10:12 -0700)
committerMika Isojärvi <misojarvi@google.com>
Mon, 21 Mar 2016 17:12:16 +0000 (10:12 -0700)
Change-Id: I4d90e82e15aa594d1fcf9de811f41bc2343a9341

modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp

index 7c9ccda..a9948f3 100644 (file)
@@ -1338,7 +1338,10 @@ TextureFormat getRandomFormat (de::Random& rng, Context& context)
        if (isES32)
                return glu::mapGLInternalFormat(de::getArrayElement(glFormats, rng.getUint32() % DE_LENGTH_OF_ARRAY(glFormats)));
        else
-               return glu::mapGLInternalFormat(de::getArrayElement(glFormats, rng.getUint32() % (DE_LENGTH_OF_ARRAY(glFormats) - 6)));
+       {
+               DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(glFormats) == 32);
+               return glu::mapGLInternalFormat(de::getArrayElement(glFormats, rng.getUint32() % (DE_LENGTH_OF_ARRAY(glFormats) - 5)));
+       }
 }
 
 void genRandomTest (de::Random& rng, BlendState& preCommon, BlendState& postCommon, vector<DrawBufferInfo>& drawBuffers, int maxDrawBufferCount, Context& context)