Lines Matching +full:int +full:- +full:array

1 /*-------------------------------------------------------------------------
3 * -------------------------------------------------
11 * http://www.apache.org/licenses/LICENSE-2.0
21 * \brief Vertex array and buffer tests
22 *//*--------------------------------------------------------------------*/
41 SingleVertexArrayUsageGroup (Context& context, Array::Usage usage);
50 Array::Usage m_usage;
53 SingleVertexArrayUsageGroup::SingleVertexArrayUsageGroup (Context& context, Array::Usage usage) in SingleVertexArrayUsageGroup()
54 …: TestCaseGroup (context, Array::usageTypeToString(usage).c_str(), Array::usageTypeToString(usage)… in SingleVertexArrayUsageGroup()
73 int counts[] = {1, 256}; in init()
74int strides[] = {0, -1, 17, 32}; // Tread negative value as sizeof input. Same as 0, but done… in init()
75Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_FIXED, Array::INPUTTYPE_… in init()
77 for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) in init()
79 for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) in init()
81 for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) in init()
83 …const int stride = (strides[strideNdx] < 0 ? Array::inputTypeSize(inputTypes[inputTypeNdx]) * 2 … in init()
84 const bool aligned = (stride % Array::inputTypeSize(inputTypes[inputTypeNdx])) == 0; in init()
85 …const std::string name = "stride" + typeToString(stride) + "_" + Array::inputTypeToString(inputTyp… in init()
88 Array::OUTPUTTYPE_VEC2, in init()
89 Array::STORAGE_BUFFER, in init()
99 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
136Array::Usage usages[] = { Array::USAGE_STATIC_DRAW, Array::USAGE_STREAM_DRAW, Array::USAGE_DYNAM… in init()
137 for (int usageNdx = 0; usageNdx < DE_LENGTH_OF_ARRAY(usages); usageNdx++) in init()
146 SingleVertexArrayStrideGroup (Context& context, Array::InputType type);
155 Array::InputType m_type;
158 SingleVertexArrayStrideGroup::SingleVertexArrayStrideGroup (Context& context, Array::InputType type) in SingleVertexArrayStrideGroup()
159 …: TestCaseGroup (context, Array::inputTypeToString(type).c_str(), Array::inputTypeToString(type).c… in SingleVertexArrayStrideGroup()
170 Array::Storage storages[] = {Array::STORAGE_USER, Array::STORAGE_BUFFER}; in init()
171 int counts[] = {1, 256}; in init()
172int strides[] = {/*0,*/ -1, 17, 32}; // Tread negative value as sizeof input. Same as 0, but … in init()
174 for (int storageNdx = 0; storageNdx < DE_LENGTH_OF_ARRAY(storages); storageNdx++) in init()
176 for (int componentCount = 2; componentCount < 5; componentCount++) in init()
178 for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) in init()
180 for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) in init()
182 …const bool packed = m_type == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_type == Array::INPUT… in init()
183 …const int stride = (strides[strideNdx] < 0) ? ((packed) ? (16) : (Array::inputTypeSize(m_type) *… in init()
184 …const int alignment = (packed) ? (Array::inputTypeSize(m_type) * componentCount) : (Array::inputT… in init()
185 …const bool bufferUnaligned = (storages[storageNdx] == Array::STORAGE_BUFFER) && (stride % alignmen… in init()
187 …std::string name = Array::storageToString(storages[storageNdx]) + "_stride" + typeToString(stride)… in init()
189 …if((m_type == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_type == Array::INPUTTYPE_INT_2_10_10_1… in init()
193 Array::OUTPUTTYPE_VEC4, in init()
195 Array::USAGE_DYNAMIC_DRAW, in init()
204 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
241Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_SHORT, Array::INPUTTYPE_… in init()
243 for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) in init()
252 SingleVertexArrayFirstGroup (Context& context, Array::InputType type);
260 Array::InputType m_type;
263 SingleVertexArrayFirstGroup::SingleVertexArrayFirstGroup (Context& context, Array::InputType type) in SingleVertexArrayFirstGroup()
264 …: TestCaseGroup (context, Array::inputTypeToString(type).c_str(), Array::inputTypeToString(type).c… in SingleVertexArrayFirstGroup()
275 int counts[] = {5, 256}; in init()
276 int firsts[] = {6, 24}; in init()
277 int offsets[] = {1, 16, 17}; in init()
278int strides[] = {/*0,*/ -1, 17, 32}; // Tread negative value as sizeof input. Same as 0, but … in init()
280 for (int offsetNdx = 0; offsetNdx < DE_LENGTH_OF_ARRAY(offsets); offsetNdx++) in init()
282 for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) in init()
284 for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) in init()
286 for (int firstNdx = 0; firstNdx < DE_LENGTH_OF_ARRAY(firsts); firstNdx++) in init()
288 …const bool packed = m_type == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_type == Array::INPUT… in init()
289 const int componentCount = (packed) ? (4) : (2); in init()
290 …const int stride = (strides[strideNdx] < 0) ? ((packed) ? (8) : (Array::inputTypeSize(m_type) * … in init()
291 …const int alignment = (packed) ? (Array::inputTypeSize(m_type) * componentCount) : (Array::inputT… in init()
296 Array::OUTPUTTYPE_VEC2, in init()
297 Array::STORAGE_BUFFER, in init()
298 Array::USAGE_DYNAMIC_DRAW, in init()
307 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
345Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_BYTE, Array::INPUTTYPE_I… in init()
347 for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) in init()
356 SingleVertexArrayOffsetGroup (Context& context, Array::InputType type);
364 Array::InputType m_type;
367 SingleVertexArrayOffsetGroup::SingleVertexArrayOffsetGroup (Context& context, Array::InputType type) in SingleVertexArrayOffsetGroup()
368 …: TestCaseGroup (context, Array::inputTypeToString(type).c_str(), Array::inputTypeToString(type).c… in SingleVertexArrayOffsetGroup()
379 int counts[] = {1, 256}; in init()
380 int offsets[] = {1, 4, 17, 32}; in init()
381int strides[] = {/*0,*/ -1, 17, 32}; // Tread negative value as sizeof input. Same as 0, but … in init()
383 for (int offsetNdx = 0; offsetNdx < DE_LENGTH_OF_ARRAY(offsets); offsetNdx++) in init()
385 for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) in init()
387 for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) in init()
389 …const bool packed = m_type == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_type == Array::INP… in init()
390 const int componentCount = (packed) ? (4) : (2); in init()
391 …const int stride = (strides[strideNdx] < 0 ? Array::inputTypeSize(m_type) * componentCount : s… in init()
392 …const int alignment = (packed) ? (Array::inputTypeSize(m_type) * componentCount) : (Array::inpu… in init()
397 Array::OUTPUTTYPE_VEC2, in init()
398 Array::STORAGE_BUFFER, in init()
399 Array::USAGE_DYNAMIC_DRAW, in init()
408 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
445Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_BYTE, Array::INPUTTYPE_I… in init()
447 for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) in init()
456 SingleVertexArrayNormalizeGroup (Context& context, Array::InputType type);
464 Array::InputType m_type;
467 SingleVertexArrayNormalizeGroup::SingleVertexArrayNormalizeGroup (Context& context, Array::InputTyp… in SingleVertexArrayNormalizeGroup()
468 …: TestCaseGroup (context, Array::inputTypeToString(type).c_str(), Array::inputTypeToString(type).c… in SingleVertexArrayNormalizeGroup()
479 int counts[] = {1, 256}; in init()
481 for (int componentCount = 2; componentCount < 5; componentCount++) in init()
483 for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) in init()
485 …if((m_type == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_type == Array::INPUTTYPE_INT_2_10_10_1… in init()
491 Array::OUTPUTTYPE_VEC4, in init()
492 Array::STORAGE_USER, in init()
493 Array::USAGE_DYNAMIC_DRAW, in init()
502 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
537Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_SHORT, Array::INPUTTYPE_… in init()
539 for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) in init()
548 SingleVertexArrayOutputTypeGroup (Context& context, Array::InputType type);
556 Array::InputType m_type;
559 SingleVertexArrayOutputTypeGroup::SingleVertexArrayOutputTypeGroup (Context& context, Array::InputT… in SingleVertexArrayOutputTypeGroup()
560 …: TestCaseGroup (context, Array::inputTypeToString(type).c_str(), Array::inputTypeToString(type).c… in SingleVertexArrayOutputTypeGroup()
571Array::OutputType outputTypes[] = {Array::OUTPUTTYPE_VEC2, Array::OUTPUTTYPE_VEC3, Array::OUTPUTTY… in init()
572 Array::Storage storages[] = {Array::STORAGE_USER}; in init()
573 int counts[] = {1, 256}; in init()
575 for (int outputTypeNdx = 0; outputTypeNdx < DE_LENGTH_OF_ARRAY(outputTypes); outputTypeNdx++) in init()
577 for (int storageNdx = 0; storageNdx < DE_LENGTH_OF_ARRAY(storages); storageNdx++) in init()
579 for (int componentCount = 2; componentCount < 5; componentCount++) in init()
581 for (int countNdx = 0; countNdx < DE_LENGTH_OF_ARRAY(counts); countNdx++) in init()
583 …std::string name = "components" + typeToString(componentCount) + "_" + Array::outputTypeToString(o… in init()
585 …bool inputIsSignedInteger = m_type == Array::INPUTTYPE_INT || m_type == Array::INPUTTYPE_SHORT ||… in init()
586 …tIsUnignedInteger = m_type == Array::INPUTTYPE_UNSIGNED_INT || m_type == Array::INPUTTYPE_UNSIGNED… in init()
587 …utputTypeNdx] == Array::OUTPUTTYPE_IVEC2 || outputTypes[outputTypeNdx] == Array::OUTPUTTYPE_IVEC3 … in init()
588 …utputTypeNdx] == Array::OUTPUTTYPE_UVEC2 || outputTypes[outputTypeNdx] == Array::OUTPUTTYPE_UVEC3 … in init()
590 // If input type is float type and output type is int type skip in init()
591 …_type == Array::INPUTTYPE_FLOAT || m_type == Array::INPUTTYPE_HALF || m_type == Array::INPUTTYPE_… in init()
594 …f((m_type == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_type == Array::INPUTTYPE_INT_2_10_10_10… in init()
597 …if((m_type == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_type == Array::INPUTTYPE_INT_2_10_10_1… in init()
609 Array::USAGE_DYNAMIC_DRAW, in init()
618 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
655Array::InputType inputTypes[] = {Array::INPUTTYPE_FLOAT, Array::INPUTTYPE_SHORT, Array::INPUTTYPE_… in init()
657 for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) in init()
732 int arrayCounts[] = {2, 3, 4, 5, 6, 7, 8}; in init()
734 for (int arrayCountNdx = 0; arrayCountNdx < DE_LENGTH_OF_ARRAY(arrayCounts); arrayCountNdx++) in init()
738 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
742 for (int arrayNdx = 0; arrayNdx < arrayCounts[arrayCountNdx]; arrayNdx++) in init()
744 MultiVertexArrayTest::Spec::ArraySpec arraySpec(Array::INPUTTYPE_FLOAT, in init()
745 Array::OUTPUTTYPE_VEC2, in init()
746 Array::STORAGE_USER, in init()
747 Array::USAGE_DYNAMIC_DRAW, in init()
752 GLValue::getMinValue(Array::INPUTTYPE_FLOAT), in init()
753 GLValue::getMaxValue(Array::INPUTTYPE_FLOAT)); in init()
777 void addStorageCases (MultiVertexArrayTest::Spec spec, int depth);
796 for (int arrayNdx = 0; arrayNdx < (int)spec.arrays.size(); arrayNdx++) in getTestName()
800 << Array::storageToString(spec.arrays[arrayNdx].storage); in getTestName()
806 void MultiVertexArrayStorageTests::addStorageCases (MultiVertexArrayTest::Spec spec, int depth) in addStorageCases()
812 for (int arrayNdx = 0; arrayNdx < (int)spec.arrays.size(); arrayNdx++) in addStorageCases()
814 if (spec.arrays[arrayNdx].storage != Array::STORAGE_USER) in addStorageCases()
831 Array::Storage storages[] = {Array::STORAGE_USER, Array::STORAGE_BUFFER}; in addStorageCases()
832 for (int storageNdx = 0; storageNdx < DE_LENGTH_OF_ARRAY(storages); storageNdx++) in addStorageCases()
834 MultiVertexArrayTest::Spec::ArraySpec arraySpec(Array::INPUTTYPE_FLOAT, in addStorageCases()
835 Array::OUTPUTTYPE_VEC2, in addStorageCases()
837 Array::USAGE_DYNAMIC_DRAW, in addStorageCases()
842 GLValue::getMinValue(Array::INPUTTYPE_FLOAT), in addStorageCases()
843 GLValue::getMaxValue(Array::INPUTTYPE_FLOAT)); in addStorageCases()
847 addStorageCases(_spec, depth-1); in addStorageCases()
855 int arrayCounts[] = {3}; in init()
859 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
863 for (int arrayCountNdx = 0; arrayCountNdx < DE_LENGTH_OF_ARRAY(arrayCounts); arrayCountNdx++) in init()
879 void addStrideCases (MultiVertexArrayTest::Spec spec, int depth);
899 for (int arrayNdx = 0; arrayNdx < (int)spec.arrays.size(); arrayNdx++) in getTestName()
903 << Array::inputTypeToString(spec.arrays[arrayNdx].inputType) in getTestName()
914 int arrayCounts[] = {3}; in init()
918 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
922 for (int arrayCountNdx = 0; arrayCountNdx < DE_LENGTH_OF_ARRAY(arrayCounts); arrayCountNdx++) in init()
926 void MultiVertexArrayStrideTests::addStrideCases (MultiVertexArrayTest::Spec spec, int depth) in addStrideCases()
936 int strides[] = {0, -1, 17, 32}; in addStrideCases()
938 for (int strideNdx = 0; strideNdx < DE_LENGTH_OF_ARRAY(strides); strideNdx++) in addStrideCases()
940 const int componentCount = 2; in addStrideCases()
941 MultiVertexArrayTest::Spec::ArraySpec arraySpec(Array::INPUTTYPE_FLOAT, in addStrideCases()
942 Array::OUTPUTTYPE_VEC2, in addStrideCases()
943 Array::STORAGE_USER, in addStrideCases()
944 Array::USAGE_DYNAMIC_DRAW, in addStrideCases()
947 …trides[strideNdx] >= 0 ? strides[strideNdx] : componentCount * Array::inputTypeSize(Array::INPUTTY… in addStrideCases()
949 GLValue::getMinValue(Array::INPUTTYPE_FLOAT), in addStrideCases()
950 GLValue::getMaxValue(Array::INPUTTYPE_FLOAT)); in addStrideCases()
954 addStrideCases(_spec, depth-1); in addStrideCases()
970 void addInputTypeCases (MultiVertexArrayTest::Spec spec, int depth);
990 for (int arrayNdx = 0; arrayNdx < (int)spec.arrays.size(); arrayNdx++) in getTestName()
994 << Array::inputTypeToString(spec.arrays[arrayNdx].inputType) in getTestName()
996 << Array::outputTypeToString(spec.arrays[arrayNdx].outputType); in getTestName()
1005 int arrayCounts[] = {3}; in init()
1009 spec.primitive = Array::PRIMITIVE_TRIANGLES; in init()
1013 for (int arrayCountNdx = 0; arrayCountNdx < DE_LENGTH_OF_ARRAY(arrayCounts); arrayCountNdx++) in init()
1017 void MultiVertexArrayOutputTests::addInputTypeCases (MultiVertexArrayTest::Spec spec, int depth) in addInputTypeCases()
1027Array::InputType inputTypes[] = {Array::INPUTTYPE_FIXED, Array::INPUTTYPE_BYTE, Array::INPUTTYPE_S… in addInputTypeCases()
1028 for (int inputTypeNdx = 0; inputTypeNdx < DE_LENGTH_OF_ARRAY(inputTypes); inputTypeNdx++) in addInputTypeCases()
1031 Array::OUTPUTTYPE_VEC2, in addInputTypeCases()
1032 Array::STORAGE_USER, in addInputTypeCases()
1033 Array::USAGE_DYNAMIC_DRAW, in addInputTypeCases()
1043 addInputTypeCases(_spec, depth-1); in addInputTypeCases()
1078 : TestCaseGroup(context, "vertex_arrays", "Vertex array and array tests") in VertexArrayTestGroup()