1e5c31af7Sopenharmony_ci/*------------------------------------------------------------------------- 2e5c31af7Sopenharmony_ci * drawElements Quality Program OpenGL ES 2.0 Module 3e5c31af7Sopenharmony_ci * ------------------------------------------------- 4e5c31af7Sopenharmony_ci * 5e5c31af7Sopenharmony_ci * Copyright 2014 The Android Open Source Project 6e5c31af7Sopenharmony_ci * 7e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 8e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License. 9e5c31af7Sopenharmony_ci * You may obtain a copy of the License at 10e5c31af7Sopenharmony_ci * 11e5c31af7Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 12e5c31af7Sopenharmony_ci * 13e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 14e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 15e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and 17e5c31af7Sopenharmony_ci * limitations under the License. 18e5c31af7Sopenharmony_ci * 19e5c31af7Sopenharmony_ci *//*! 20e5c31af7Sopenharmony_ci * \file 21e5c31af7Sopenharmony_ci * \brief Vertex array and buffer unaligned access stress tests 22e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/ 23e5c31af7Sopenharmony_ci 24e5c31af7Sopenharmony_ci#include "es2sVertexArrayTests.hpp" 25e5c31af7Sopenharmony_ci#include "glsVertexArrayTests.hpp" 26e5c31af7Sopenharmony_ci 27e5c31af7Sopenharmony_ci#include "glwEnums.hpp" 28e5c31af7Sopenharmony_ci 29e5c31af7Sopenharmony_ciusing namespace deqp::gls; 30e5c31af7Sopenharmony_ci 31e5c31af7Sopenharmony_cinamespace deqp 32e5c31af7Sopenharmony_ci{ 33e5c31af7Sopenharmony_cinamespace gles2 34e5c31af7Sopenharmony_ci{ 35e5c31af7Sopenharmony_cinamespace Stress 36e5c31af7Sopenharmony_ci{ 37e5c31af7Sopenharmony_cinamespace 38e5c31af7Sopenharmony_ci{ 39e5c31af7Sopenharmony_ci 40e5c31af7Sopenharmony_citemplate<class T> 41e5c31af7Sopenharmony_cistatic std::string typeToString (T t) 42e5c31af7Sopenharmony_ci{ 43e5c31af7Sopenharmony_ci std::stringstream strm; 44e5c31af7Sopenharmony_ci strm << t; 45e5c31af7Sopenharmony_ci return strm.str(); 46e5c31af7Sopenharmony_ci} 47e5c31af7Sopenharmony_ci 48e5c31af7Sopenharmony_ciclass SingleVertexArrayUsageTests : public TestCaseGroup 49e5c31af7Sopenharmony_ci{ 50e5c31af7Sopenharmony_cipublic: 51e5c31af7Sopenharmony_ci SingleVertexArrayUsageTests (Context& context); 52e5c31af7Sopenharmony_ci virtual ~SingleVertexArrayUsageTests (void); 53e5c31af7Sopenharmony_ci 54e5c31af7Sopenharmony_ci virtual void init (void); 55e5c31af7Sopenharmony_ci 56e5c31af7Sopenharmony_ciprivate: 57e5c31af7Sopenharmony_ci SingleVertexArrayUsageTests (const SingleVertexArrayUsageTests& other); 58e5c31af7Sopenharmony_ci SingleVertexArrayUsageTests& operator= (const SingleVertexArrayUsageTests& other); 59e5c31af7Sopenharmony_ci}; 60e5c31af7Sopenharmony_ci 61e5c31af7Sopenharmony_ciSingleVertexArrayUsageTests::SingleVertexArrayUsageTests (Context& context) 62e5c31af7Sopenharmony_ci : TestCaseGroup(context, "usages", "Single vertex atribute, usage") 63e5c31af7Sopenharmony_ci{ 64e5c31af7Sopenharmony_ci} 65e5c31af7Sopenharmony_ci 66e5c31af7Sopenharmony_ciSingleVertexArrayUsageTests::~SingleVertexArrayUsageTests (void) 67e5c31af7Sopenharmony_ci{ 68e5c31af7Sopenharmony_ci} 69e5c31af7Sopenharmony_ci 70e5c31af7Sopenharmony_civoid SingleVertexArrayUsageTests::init (void) 71e5c31af7Sopenharmony_ci{ 72e5c31af7Sopenharmony_ci // Test usage 73e5c31af7Sopenharmony_ci Array::Usage usages[] = {Array::USAGE_STATIC_DRAW, Array::USAGE_STREAM_DRAW, Array::USAGE_DYNAMIC_DRAW}; 74e5c31af7Sopenharmony_ci int counts[] = {1, 256}; 75e5c31af7Sopenharmony_ci int strides[] = {17}; 76e5c31af7Sopenharmony_ci Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_FIXED, Array::INPUTTYPE_SHORT, Array::INPUTTYPE_BYTE}; 77e5c31af7Sopenharmony_ci 78e5c31af7Sopenharmony_ci for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) 79e5c31af7Sopenharmony_ci { 80e5c31af7Sopenharmony_ci for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) 81e5c31af7Sopenharmony_ci { 82e5c31af7Sopenharmony_ci for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) 83e5c31af7Sopenharmony_ci { 84e5c31af7Sopenharmony_ci for (int usageNdx = 0; usageNdx < DE_LENGTH_OF_ARRAY(usages); usageNdx++) 85e5c31af7Sopenharmony_ci { 86e5c31af7Sopenharmony_ci const int componentCount = 2; 87e5c31af7Sopenharmony_ci const int stride = (strides[strideNdx] < 0 ? Array::inputTypeSize(inputTypes[inputTypeNdx]) * componentCount : strides[strideNdx]); 88e5c31af7Sopenharmony_ci const bool aligned = (stride % Array::inputTypeSize(inputTypes[inputTypeNdx])) == 0; 89e5c31af7Sopenharmony_ci MultiVertexArrayTest::Spec::ArraySpec arraySpec(inputTypes[inputTypeNdx], 90e5c31af7Sopenharmony_ci Array::OUTPUTTYPE_VEC2, 91e5c31af7Sopenharmony_ci Array::STORAGE_BUFFER, 92e5c31af7Sopenharmony_ci usages[usageNdx], 93e5c31af7Sopenharmony_ci componentCount, 94e5c31af7Sopenharmony_ci 0, 95e5c31af7Sopenharmony_ci stride, 96e5c31af7Sopenharmony_ci false, 97e5c31af7Sopenharmony_ci GLValue::getMinValue(inputTypes[inputTypeNdx]), 98e5c31af7Sopenharmony_ci GLValue::getMaxValue(inputTypes[inputTypeNdx])); 99e5c31af7Sopenharmony_ci 100e5c31af7Sopenharmony_ci MultiVertexArrayTest::Spec spec; 101e5c31af7Sopenharmony_ci spec.primitive = Array::PRIMITIVE_TRIANGLES; 102e5c31af7Sopenharmony_ci spec.drawCount = counts[countNdx]; 103e5c31af7Sopenharmony_ci spec.first = 0; 104e5c31af7Sopenharmony_ci spec.arrays.push_back(arraySpec); 105e5c31af7Sopenharmony_ci 106e5c31af7Sopenharmony_ci std::string name = spec.getName(); 107e5c31af7Sopenharmony_ci 108e5c31af7Sopenharmony_ci if (!aligned) 109e5c31af7Sopenharmony_ci addChild(new MultiVertexArrayTest(m_testCtx, m_context.getRenderContext(), spec, name.c_str(), name.c_str())); 110e5c31af7Sopenharmony_ci } 111e5c31af7Sopenharmony_ci } 112e5c31af7Sopenharmony_ci } 113e5c31af7Sopenharmony_ci } 114e5c31af7Sopenharmony_ci} 115e5c31af7Sopenharmony_ci 116e5c31af7Sopenharmony_ciclass SingleVertexArrayStrideTests : public TestCaseGroup 117e5c31af7Sopenharmony_ci{ 118e5c31af7Sopenharmony_cipublic: 119e5c31af7Sopenharmony_ci SingleVertexArrayStrideTests (Context& context); 120e5c31af7Sopenharmony_ci virtual ~SingleVertexArrayStrideTests (void); 121e5c31af7Sopenharmony_ci 122e5c31af7Sopenharmony_ci virtual void init (void); 123e5c31af7Sopenharmony_ci 124e5c31af7Sopenharmony_ciprivate: 125e5c31af7Sopenharmony_ci SingleVertexArrayStrideTests (const SingleVertexArrayStrideTests& other); 126e5c31af7Sopenharmony_ci SingleVertexArrayStrideTests& operator= (const SingleVertexArrayStrideTests& other); 127e5c31af7Sopenharmony_ci}; 128e5c31af7Sopenharmony_ci 129e5c31af7Sopenharmony_ciSingleVertexArrayStrideTests::SingleVertexArrayStrideTests (Context& context) 130e5c31af7Sopenharmony_ci : TestCaseGroup(context, "strides", "Single stride vertex atribute") 131e5c31af7Sopenharmony_ci{ 132e5c31af7Sopenharmony_ci} 133e5c31af7Sopenharmony_ci 134e5c31af7Sopenharmony_ciSingleVertexArrayStrideTests::~SingleVertexArrayStrideTests (void) 135e5c31af7Sopenharmony_ci{ 136e5c31af7Sopenharmony_ci} 137e5c31af7Sopenharmony_ci 138e5c31af7Sopenharmony_civoid SingleVertexArrayStrideTests::init (void) 139e5c31af7Sopenharmony_ci{ 140e5c31af7Sopenharmony_ci // Test strides with different input types, component counts and storage, Usage(?) 141e5c31af7Sopenharmony_ci Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_SHORT, Array::INPUTTYPE_BYTE, /*Array::INPUTTYPE_UNSIGNED_SHORT, Array::INPUTTYPE_UNSIGNED_BYTE,*/ Array::INPUTTYPE_FIXED}; 142e5c31af7Sopenharmony_ci Array::Storage storages[] = {Array::STORAGE_BUFFER}; 143e5c31af7Sopenharmony_ci int counts[] = {1, 256}; 144e5c31af7Sopenharmony_ci int strides[] = {17}; 145e5c31af7Sopenharmony_ci 146e5c31af7Sopenharmony_ci for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) 147e5c31af7Sopenharmony_ci { 148e5c31af7Sopenharmony_ci for (int storageNdx = 0; storageNdx < DE_LENGTH_OF_ARRAY(storages); storageNdx++) 149e5c31af7Sopenharmony_ci { 150e5c31af7Sopenharmony_ci for (int componentCount = 2; componentCount < 5; componentCount++) 151e5c31af7Sopenharmony_ci { 152e5c31af7Sopenharmony_ci for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) 153e5c31af7Sopenharmony_ci { 154e5c31af7Sopenharmony_ci for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) 155e5c31af7Sopenharmony_ci { 156e5c31af7Sopenharmony_ci const int stride = (strides[strideNdx] < 0 ? Array::inputTypeSize(inputTypes[inputTypeNdx]) * componentCount : strides[strideNdx]); 157e5c31af7Sopenharmony_ci const bool bufferUnaligned = (storages[storageNdx] == Array::STORAGE_BUFFER) && (stride % Array::inputTypeSize(inputTypes[inputTypeNdx])) != 0; 158e5c31af7Sopenharmony_ci 159e5c31af7Sopenharmony_ci MultiVertexArrayTest::Spec::ArraySpec arraySpec(inputTypes[inputTypeNdx], 160e5c31af7Sopenharmony_ci Array::OUTPUTTYPE_VEC4, 161e5c31af7Sopenharmony_ci storages[storageNdx], 162e5c31af7Sopenharmony_ci Array::USAGE_DYNAMIC_DRAW, 163e5c31af7Sopenharmony_ci componentCount, 164e5c31af7Sopenharmony_ci 0, 165e5c31af7Sopenharmony_ci stride, 166e5c31af7Sopenharmony_ci false, 167e5c31af7Sopenharmony_ci GLValue::getMinValue(inputTypes[inputTypeNdx]), 168e5c31af7Sopenharmony_ci GLValue::getMaxValue(inputTypes[inputTypeNdx])); 169e5c31af7Sopenharmony_ci 170e5c31af7Sopenharmony_ci MultiVertexArrayTest::Spec spec; 171e5c31af7Sopenharmony_ci spec.primitive = Array::PRIMITIVE_TRIANGLES; 172e5c31af7Sopenharmony_ci spec.drawCount = counts[countNdx]; 173e5c31af7Sopenharmony_ci spec.first = 0; 174e5c31af7Sopenharmony_ci spec.arrays.push_back(arraySpec); 175e5c31af7Sopenharmony_ci 176e5c31af7Sopenharmony_ci std::string name = spec.getName(); 177e5c31af7Sopenharmony_ci if (bufferUnaligned) 178e5c31af7Sopenharmony_ci addChild(new MultiVertexArrayTest(m_testCtx, m_context.getRenderContext(), spec, name.c_str(), name.c_str())); 179e5c31af7Sopenharmony_ci } 180e5c31af7Sopenharmony_ci } 181e5c31af7Sopenharmony_ci } 182e5c31af7Sopenharmony_ci } 183e5c31af7Sopenharmony_ci } 184e5c31af7Sopenharmony_ci} 185e5c31af7Sopenharmony_ci 186e5c31af7Sopenharmony_ciclass SingleVertexArrayFirstTests : public TestCaseGroup 187e5c31af7Sopenharmony_ci{ 188e5c31af7Sopenharmony_cipublic: 189e5c31af7Sopenharmony_ci SingleVertexArrayFirstTests (Context& context); 190e5c31af7Sopenharmony_ci virtual ~SingleVertexArrayFirstTests (void); 191e5c31af7Sopenharmony_ci 192e5c31af7Sopenharmony_ci virtual void init (void); 193e5c31af7Sopenharmony_ci 194e5c31af7Sopenharmony_ciprivate: 195e5c31af7Sopenharmony_ci SingleVertexArrayFirstTests (const SingleVertexArrayFirstTests& other); 196e5c31af7Sopenharmony_ci SingleVertexArrayFirstTests& operator= (const SingleVertexArrayFirstTests& other); 197e5c31af7Sopenharmony_ci}; 198e5c31af7Sopenharmony_ci 199e5c31af7Sopenharmony_ciSingleVertexArrayFirstTests::SingleVertexArrayFirstTests (Context& context) 200e5c31af7Sopenharmony_ci : TestCaseGroup(context, "first", "Single vertex atribute different first values") 201e5c31af7Sopenharmony_ci{ 202e5c31af7Sopenharmony_ci} 203e5c31af7Sopenharmony_ci 204e5c31af7Sopenharmony_ciSingleVertexArrayFirstTests::~SingleVertexArrayFirstTests (void) 205e5c31af7Sopenharmony_ci{ 206e5c31af7Sopenharmony_ci} 207e5c31af7Sopenharmony_ci 208e5c31af7Sopenharmony_civoid SingleVertexArrayFirstTests::init (void) 209e5c31af7Sopenharmony_ci{ 210e5c31af7Sopenharmony_ci // Test strides with different input types, component counts and storage, Usage(?) 211e5c31af7Sopenharmony_ci Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_BYTE, Array::INPUTTYPE_FIXED}; 212e5c31af7Sopenharmony_ci int counts[] = {5, 256}; 213e5c31af7Sopenharmony_ci int firsts[] = {6, 24}; 214e5c31af7Sopenharmony_ci int offsets[] = {1, 17}; 215e5c31af7Sopenharmony_ci int strides[] = {/*0,*/ -1, 17, 32}; // Tread negative value as sizeof input. Same as 0, but done outside of GL. 216e5c31af7Sopenharmony_ci 217e5c31af7Sopenharmony_ci for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) 218e5c31af7Sopenharmony_ci { 219e5c31af7Sopenharmony_ci for (int offsetNdx = 0; offsetNdx < DE_LENGTH_OF_ARRAY(offsets); offsetNdx++) 220e5c31af7Sopenharmony_ci { 221e5c31af7Sopenharmony_ci for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) 222e5c31af7Sopenharmony_ci { 223e5c31af7Sopenharmony_ci for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) 224e5c31af7Sopenharmony_ci { 225e5c31af7Sopenharmony_ci for (int firstNdx = 0; firstNdx < DE_LENGTH_OF_ARRAY(firsts); firstNdx++) 226e5c31af7Sopenharmony_ci { 227e5c31af7Sopenharmony_ci const int stride = (strides[strideNdx] < 0 ? Array::inputTypeSize(inputTypes[inputTypeNdx]) * 2 : strides[strideNdx]); 228e5c31af7Sopenharmony_ci const bool aligned = ((stride % Array::inputTypeSize(inputTypes[inputTypeNdx])) == 0) && (offsets[offsetNdx] % Array::inputTypeSize(inputTypes[inputTypeNdx]) == 0); 229e5c31af7Sopenharmony_ci 230e5c31af7Sopenharmony_ci MultiVertexArrayTest::Spec::ArraySpec arraySpec(inputTypes[inputTypeNdx], 231e5c31af7Sopenharmony_ci Array::OUTPUTTYPE_VEC2, 232e5c31af7Sopenharmony_ci Array::STORAGE_BUFFER, 233e5c31af7Sopenharmony_ci Array::USAGE_DYNAMIC_DRAW, 234e5c31af7Sopenharmony_ci 2, 235e5c31af7Sopenharmony_ci offsets[offsetNdx], 236e5c31af7Sopenharmony_ci stride, 237e5c31af7Sopenharmony_ci false, 238e5c31af7Sopenharmony_ci GLValue::getMinValue(inputTypes[inputTypeNdx]), 239e5c31af7Sopenharmony_ci GLValue::getMaxValue(inputTypes[inputTypeNdx])); 240e5c31af7Sopenharmony_ci 241e5c31af7Sopenharmony_ci MultiVertexArrayTest::Spec spec; 242e5c31af7Sopenharmony_ci spec.primitive = Array::PRIMITIVE_TRIANGLES; 243e5c31af7Sopenharmony_ci spec.drawCount = counts[countNdx]; 244e5c31af7Sopenharmony_ci spec.first = firsts[firstNdx]; 245e5c31af7Sopenharmony_ci spec.arrays.push_back(arraySpec); 246e5c31af7Sopenharmony_ci 247e5c31af7Sopenharmony_ci std::string name = Array::inputTypeToString(inputTypes[inputTypeNdx]) + "_first" + typeToString(firsts[firstNdx]) + "_offset" + typeToString(offsets[offsetNdx]) + "_stride" + typeToString(stride) + "_quads" + typeToString(counts[countNdx]); 248e5c31af7Sopenharmony_ci if (!aligned) 249e5c31af7Sopenharmony_ci addChild(new MultiVertexArrayTest(m_testCtx, m_context.getRenderContext(), spec, name.c_str(), name.c_str())); 250e5c31af7Sopenharmony_ci } 251e5c31af7Sopenharmony_ci } 252e5c31af7Sopenharmony_ci } 253e5c31af7Sopenharmony_ci } 254e5c31af7Sopenharmony_ci } 255e5c31af7Sopenharmony_ci} 256e5c31af7Sopenharmony_ci 257e5c31af7Sopenharmony_ciclass SingleVertexArrayOffsetTests : public TestCaseGroup 258e5c31af7Sopenharmony_ci{ 259e5c31af7Sopenharmony_cipublic: 260e5c31af7Sopenharmony_ci SingleVertexArrayOffsetTests (Context& context); 261e5c31af7Sopenharmony_ci virtual ~SingleVertexArrayOffsetTests (void); 262e5c31af7Sopenharmony_ci 263e5c31af7Sopenharmony_ci virtual void init (void); 264e5c31af7Sopenharmony_ci 265e5c31af7Sopenharmony_ciprivate: 266e5c31af7Sopenharmony_ci SingleVertexArrayOffsetTests (const SingleVertexArrayOffsetTests& other); 267e5c31af7Sopenharmony_ci SingleVertexArrayOffsetTests& operator= (const SingleVertexArrayOffsetTests& other); 268e5c31af7Sopenharmony_ci}; 269e5c31af7Sopenharmony_ci 270e5c31af7Sopenharmony_ciSingleVertexArrayOffsetTests::SingleVertexArrayOffsetTests (Context& context) 271e5c31af7Sopenharmony_ci : TestCaseGroup(context, "offset", "Single vertex atribute offset element") 272e5c31af7Sopenharmony_ci{ 273e5c31af7Sopenharmony_ci} 274e5c31af7Sopenharmony_ci 275e5c31af7Sopenharmony_ciSingleVertexArrayOffsetTests::~SingleVertexArrayOffsetTests (void) 276e5c31af7Sopenharmony_ci{ 277e5c31af7Sopenharmony_ci} 278e5c31af7Sopenharmony_ci 279e5c31af7Sopenharmony_civoid SingleVertexArrayOffsetTests::init (void) 280e5c31af7Sopenharmony_ci{ 281e5c31af7Sopenharmony_ci // Test strides with different input types, component counts and storage, Usage(?) 282e5c31af7Sopenharmony_ci Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_BYTE, Array::INPUTTYPE_FIXED}; 283e5c31af7Sopenharmony_ci int counts[] = {1, 256}; 284e5c31af7Sopenharmony_ci int offsets[] = {1, 4, 17, 32}; 285e5c31af7Sopenharmony_ci int strides[] = {/*0,*/ -1, 17, 32}; // Tread negative value as sizeof input. Same as 0, but done outside of GL. 286e5c31af7Sopenharmony_ci 287e5c31af7Sopenharmony_ci for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) 288e5c31af7Sopenharmony_ci { 289e5c31af7Sopenharmony_ci for (int offsetNdx = 0; offsetNdx < DE_LENGTH_OF_ARRAY(offsets); offsetNdx++) 290e5c31af7Sopenharmony_ci { 291e5c31af7Sopenharmony_ci for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) 292e5c31af7Sopenharmony_ci { 293e5c31af7Sopenharmony_ci for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) 294e5c31af7Sopenharmony_ci { 295e5c31af7Sopenharmony_ci const int stride = (strides[strideNdx] < 0 ? Array::inputTypeSize(inputTypes[inputTypeNdx]) * 2 : strides[strideNdx]); 296e5c31af7Sopenharmony_ci const bool aligned = ((stride % Array::inputTypeSize(inputTypes[inputTypeNdx])) == 0) && ((offsets[offsetNdx] % Array::inputTypeSize(inputTypes[inputTypeNdx])) == 0); 297e5c31af7Sopenharmony_ci 298e5c31af7Sopenharmony_ci MultiVertexArrayTest::Spec::ArraySpec arraySpec(inputTypes[inputTypeNdx], 299e5c31af7Sopenharmony_ci Array::OUTPUTTYPE_VEC2, 300e5c31af7Sopenharmony_ci Array::STORAGE_BUFFER, 301e5c31af7Sopenharmony_ci Array::USAGE_DYNAMIC_DRAW, 302e5c31af7Sopenharmony_ci 2, 303e5c31af7Sopenharmony_ci offsets[offsetNdx], 304e5c31af7Sopenharmony_ci stride, 305e5c31af7Sopenharmony_ci false, 306e5c31af7Sopenharmony_ci GLValue::getMinValue(inputTypes[inputTypeNdx]), 307e5c31af7Sopenharmony_ci GLValue::getMaxValue(inputTypes[inputTypeNdx])); 308e5c31af7Sopenharmony_ci 309e5c31af7Sopenharmony_ci MultiVertexArrayTest::Spec spec; 310e5c31af7Sopenharmony_ci spec.primitive = Array::PRIMITIVE_TRIANGLES; 311e5c31af7Sopenharmony_ci spec.drawCount = counts[countNdx]; 312e5c31af7Sopenharmony_ci spec.first = 0; 313e5c31af7Sopenharmony_ci spec.arrays.push_back(arraySpec); 314e5c31af7Sopenharmony_ci 315e5c31af7Sopenharmony_ci std::string name = spec.getName(); 316e5c31af7Sopenharmony_ci if (!aligned) 317e5c31af7Sopenharmony_ci addChild(new MultiVertexArrayTest(m_testCtx, m_context.getRenderContext(), spec, name.c_str(), name.c_str())); 318e5c31af7Sopenharmony_ci } 319e5c31af7Sopenharmony_ci } 320e5c31af7Sopenharmony_ci } 321e5c31af7Sopenharmony_ci } 322e5c31af7Sopenharmony_ci} 323e5c31af7Sopenharmony_ci 324e5c31af7Sopenharmony_ci} // anonymous 325e5c31af7Sopenharmony_ci 326e5c31af7Sopenharmony_ciVertexArrayTests::VertexArrayTests (Context& context) 327e5c31af7Sopenharmony_ci : TestCaseGroup(context, "vertex_arrays", "Vertex array and array tests") 328e5c31af7Sopenharmony_ci{ 329e5c31af7Sopenharmony_ci} 330e5c31af7Sopenharmony_ci 331e5c31af7Sopenharmony_ciVertexArrayTests::~VertexArrayTests (void) 332e5c31af7Sopenharmony_ci{ 333e5c31af7Sopenharmony_ci} 334e5c31af7Sopenharmony_ci 335e5c31af7Sopenharmony_civoid VertexArrayTests::init (void) 336e5c31af7Sopenharmony_ci{ 337e5c31af7Sopenharmony_ci tcu::TestCaseGroup* const group = new tcu::TestCaseGroup(m_testCtx, "single_attribute", "Single attribute"); 338e5c31af7Sopenharmony_ci addChild(group); 339e5c31af7Sopenharmony_ci 340e5c31af7Sopenharmony_ci // .single_attribute 341e5c31af7Sopenharmony_ci { 342e5c31af7Sopenharmony_ci group->addChild(new SingleVertexArrayStrideTests(m_context)); 343e5c31af7Sopenharmony_ci group->addChild(new SingleVertexArrayUsageTests(m_context)); 344e5c31af7Sopenharmony_ci group->addChild(new SingleVertexArrayOffsetTests(m_context)); 345e5c31af7Sopenharmony_ci group->addChild(new SingleVertexArrayFirstTests(m_context)); 346e5c31af7Sopenharmony_ci } 347e5c31af7Sopenharmony_ci} 348e5c31af7Sopenharmony_ci 349e5c31af7Sopenharmony_ci} // Stress 350e5c31af7Sopenharmony_ci} // gles2 351e5c31af7Sopenharmony_ci} // deqp 352