Lines Matching refs:DrawTestSpec
54 static void addTestIterations (gls::DrawTest* test, const gls::DrawTestSpec& baseSpec, TestIterationType type)
56 gls::DrawTestSpec spec(baseSpec);
91 if (spec.primitive == gls::DrawTestSpec::PRIMITIVE_POINTS)
102 static void genBasicSpec (gls::DrawTestSpec& spec, gls::DrawTestSpec::DrawMethod method)
105 spec.primitive = gls::DrawTestSpec::PRIMITIVE_TRIANGLES;
108 spec.indexType = gls::DrawTestSpec::INDEXTYPE_LAST;
110 spec.indexStorage = gls::DrawTestSpec::STORAGE_LAST;
118 spec.attribs[0].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
119 spec.attribs[0].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
120 spec.attribs[0].storage = gls::DrawTestSpec::STORAGE_BUFFER;
121 spec.attribs[0].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
129 spec.attribs[1].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
130 spec.attribs[1].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
131 spec.attribs[1].storage = gls::DrawTestSpec::STORAGE_BUFFER;
132 spec.attribs[1].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
144 AttributeGroup (Context& context, const char* name, const char* descr, gls::DrawTestSpec::DrawMethod drawMethod, gls::DrawTestSpec::Primitive primitive, gls::DrawTestSpec::IndexType indexType, gls::DrawTestSpec::Storage indexStorage);
150 gls::DrawTestSpec::DrawMethod m_method;
151 gls::DrawTestSpec::Primitive m_primitive;
152 gls::DrawTestSpec::IndexType m_indexType;
153 gls::DrawTestSpec::Storage m_indexStorage;
156 AttributeGroup::AttributeGroup (Context& context, const char* name, const char* descr, gls::DrawTestSpec::DrawMethod drawMethod, gls::DrawTestSpec::Primitive primitive, gls::DrawTestSpec::IndexType indexType, gls::DrawTestSpec::Storage indexStorage)
172 const bool instanced = (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWARRAYS_INSTANCED) ||
173 (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED);
174 const bool ranged = (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED);
180 gls::DrawTestSpec spec;
196 spec.attribs[0].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
197 spec.attribs[0].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
198 spec.attribs[0].storage = gls::DrawTestSpec::STORAGE_BUFFER;
199 spec.attribs[0].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
215 gls::DrawTestSpec spec;
231 spec.attribs[0].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
232 spec.attribs[0].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
233 spec.attribs[0].storage = gls::DrawTestSpec::STORAGE_BUFFER;
234 spec.attribs[0].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
242 spec.attribs[1].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
243 spec.attribs[1].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
244 spec.attribs[1].storage = gls::DrawTestSpec::STORAGE_BUFFER;
245 spec.attribs[1].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
261 gls::DrawTestSpec spec;
277 spec.attribs[0].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
278 spec.attribs[0].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
279 spec.attribs[0].storage = gls::DrawTestSpec::STORAGE_BUFFER;
280 spec.attribs[0].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
289 spec.attribs[1].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
290 spec.attribs[1].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
291 spec.attribs[1].storage = gls::DrawTestSpec::STORAGE_BUFFER;
292 spec.attribs[1].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
302 spec.attribs[2].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
303 spec.attribs[2].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
304 spec.attribs[2].storage = gls::DrawTestSpec::STORAGE_BUFFER;
305 spec.attribs[2].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
321 gls::DrawTestSpec spec;
337 spec.attribs[0].inputType = gls::DrawTestSpec::INPUTTYPE_FLOAT;
338 spec.attribs[0].outputType = gls::DrawTestSpec::OUTPUTTYPE_VEC2;
339 spec.attribs[0].storage = gls::DrawTestSpec::STORAGE_BUFFER;
340 spec.attribs[0].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
350 gls::DrawTestSpec::InputType input;
351 gls::DrawTestSpec::OutputType output;
355 { gls::DrawTestSpec::INPUTTYPE_FLOAT, gls::DrawTestSpec::OUTPUTTYPE_VEC2, 4 },
356 { gls::DrawTestSpec::INPUTTYPE_FLOAT, gls::DrawTestSpec::OUTPUTTYPE_VEC4, 2 },
357 { gls::DrawTestSpec::INPUTTYPE_INT, gls::DrawTestSpec::OUTPUTTYPE_IVEC3, 4 },
358 { gls::DrawTestSpec::INPUTTYPE_UNSIGNED_INT, gls::DrawTestSpec::OUTPUTTYPE_UVEC2, 4 },
363 const std::string desc = gls::DrawTestSpec::inputTypeToString(iopairs[ioNdx].input) + de::toString(iopairs[ioNdx].componentCount) + " to " + gls::DrawTestSpec::outputTypeToString(iopairs[ioNdx].output);
367 spec.attribs[1].storage = gls::DrawTestSpec::STORAGE_BUFFER;
368 spec.attribs[1].usage = gls::DrawTestSpec::USAGE_STATIC_DRAW;
386 IndexGroup (Context& context, const char* name, const char* descr, gls::DrawTestSpec::DrawMethod drawMethod);
392 gls::DrawTestSpec::DrawMethod m_method;
395 IndexGroup::IndexGroup (Context& context, const char* name, const char* descr, gls::DrawTestSpec::DrawMethod drawMethod)
409 gls::DrawTestSpec::Storage storage;
410 gls::DrawTestSpec::IndexType type;
417 { gls::DrawTestSpec::STORAGE_USER, gls::DrawTestSpec::INDEXTYPE_BYTE, true, { 0, 1, -1 } },
418 { gls::DrawTestSpec::STORAGE_USER, gls::DrawTestSpec::INDEXTYPE_SHORT, true, { 0, 2, -1 } },
419 { gls::DrawTestSpec::STORAGE_USER, gls::DrawTestSpec::INDEXTYPE_INT, true, { 0, 4, -1 } },
421 { gls::DrawTestSpec::STORAGE_USER, gls::DrawTestSpec::INDEXTYPE_SHORT, false, { 1, 3, -1 } },
422 { gls::DrawTestSpec::STORAGE_USER, gls::DrawTestSpec::INDEXTYPE_INT, false, { 2, 3, -1 } },
424 { gls::DrawTestSpec::STORAGE_BUFFER, gls::DrawTestSpec::INDEXTYPE_BYTE, true, { 0, 1, -1 } },
425 { gls::DrawTestSpec::STORAGE_BUFFER, gls::DrawTestSpec::INDEXTYPE_SHORT, true, { 0, 2, -1 } },
426 { gls::DrawTestSpec::STORAGE_BUFFER, gls::DrawTestSpec::INDEXTYPE_INT, true, { 0, 4, -1 } },
429 gls::DrawTestSpec spec;
444 tcu::TestCaseGroup* group = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER)
448 const std::string name = std::string("index_") + gls::DrawTestSpec::indexTypeToString(indexTest.type);
449 const std::string desc = std::string("index ") + gls::DrawTestSpec::indexTypeToString(indexTest.type) + " in " + gls::DrawTestSpec::storageToString(indexTest.storage);
462 DE_ASSERT(spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET);
463 DE_ASSERT(spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE);
472 FirstGroup (Context& context, const char* name, const char* descr, gls::DrawTestSpec::DrawMethod drawMethod);
478 gls::DrawTestSpec::DrawMethod m_method;
481 FirstGroup::FirstGroup (Context& context, const char* name, const char* descr, gls::DrawTestSpec::DrawMethod drawMethod)
498 gls::DrawTestSpec spec;
518 MethodGroup (Context& context, const char* name, const char* descr, gls::DrawTestSpec::DrawMethod drawMethod);
524 gls::DrawTestSpec::DrawMethod m_method;
527 MethodGroup::MethodGroup (Context& context, const char* name, const char* descr, gls::DrawTestSpec::DrawMethod drawMethod)
539 const bool indexed = (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS) || (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED) || (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED);
540 const bool hasFirst = (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWARRAYS) || (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWARRAYS_INSTANCED);
542 const gls::DrawTestSpec::Primitive primitive[] =
544 gls::DrawTestSpec::PRIMITIVE_POINTS,
545 gls::DrawTestSpec::PRIMITIVE_TRIANGLES,
546 gls::DrawTestSpec::PRIMITIVE_TRIANGLE_FAN,
547 gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP,
548 gls::DrawTestSpec::PRIMITIVE_LINES,
549 gls::DrawTestSpec::PRIMITIVE_LINE_STRIP,
550 gls::DrawTestSpec::PRIMITIVE_LINE_LOOP
562 if (m_method != gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED)
568 const std::string name = gls::DrawTestSpec::primitiveToString(primitive[ndx]);
569 const std::string desc = gls::DrawTestSpec::primitiveToString(primitive[ndx]);
571 this->addChild(new AttributeGroup(m_context, name.c_str(), desc.c_str(), m_method, primitive[ndx], gls::DrawTestSpec::INDEXTYPE_SHORT, gls::DrawTestSpec::STORAGE_BUFFER));
933 static const gls::DrawTestSpec::Primitive primitives[] =
935 gls::DrawTestSpec::PRIMITIVE_POINTS,
936 gls::DrawTestSpec::PRIMITIVE_TRIANGLES,
937 gls::DrawTestSpec::PRIMITIVE_TRIANGLE_FAN,
938 gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP,
939 gls::DrawTestSpec::PRIMITIVE_LINES,
940 gls::DrawTestSpec::PRIMITIVE_LINE_STRIP,
941 gls::DrawTestSpec::PRIMITIVE_LINE_LOOP
945 static const gls::DrawTestSpec::DrawMethod drawMethods[] =
947 gls::DrawTestSpec::DRAWMETHOD_DRAWARRAYS,
948 gls::DrawTestSpec::DRAWMETHOD_DRAWARRAYS_INSTANCED,
949 gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS,
950 gls::DrawTestSpec
951 gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED
955 static const gls::DrawTestSpec::IndexType indexTypes[] =
957 gls::DrawTestSpec::INDEXTYPE_BYTE,
958 gls::DrawTestSpec::INDEXTYPE_SHORT,
959 gls::DrawTestSpec::INDEXTYPE_INT,
963 static const gls::DrawTestSpec::Storage storages[] =
965 gls::DrawTestSpec::STORAGE_USER,
966 gls::DrawTestSpec::STORAGE_BUFFER,
970 static const gls::DrawTestSpec::InputType inputTypes[] =
972 gls::DrawTestSpec::INPUTTYPE_FLOAT,
973 gls::DrawTestSpec::INPUTTYPE_FIXED,
974 gls::DrawTestSpec::INPUTTYPE_BYTE,
975 gls::DrawTestSpec::INPUTTYPE_SHORT,
976 gls::DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE,
977 gls::DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT,
978 gls::DrawTestSpec::INPUTTYPE_INT,
979 gls::DrawTestSpec::INPUTTYPE_UNSIGNED_INT,
980 gls::DrawTestSpec::INPUTTYPE_HALF,
981 gls::DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10,
982 gls::DrawTestSpec::INPUTTYPE_INT_2_10_10_10,
986 static const gls::DrawTestSpec::OutputType outputTypes[] =
988 gls::DrawTestSpec::OUTPUTTYPE_FLOAT,
989 gls::DrawTestSpec::OUTPUTTYPE_VEC2,
990 gls::DrawTestSpec::OUTPUTTYPE_VEC3,
991 gls::DrawTestSpec::OUTPUTTYPE_VEC4,
992 gls::DrawTestSpec::OUTPUTTYPE_INT,
993 gls::DrawTestSpec::OUTPUTTYPE_UINT,
994 gls::DrawTestSpec::OUTPUTTYPE_IVEC2,
995 gls::DrawTestSpec::OUTPUTTYPE_IVEC3,
996 gls::DrawTestSpec::OUTPUTTYPE_IVEC4,
997 gls::DrawTestSpec::OUTPUTTYPE_UVEC2,
998 gls::DrawTestSpec::OUTPUTTYPE_UVEC3,
999 gls::DrawTestSpec::OUTPUTTYPE_UVEC4,
1003 static const gls::DrawTestSpec::Usage usages[] =
1005 gls::DrawTestSpec::USAGE_DYNAMIC_DRAW,
1006 gls::DrawTestSpec::USAGE_STATIC_DRAW,
1007 gls::DrawTestSpec::USAGE_STREAM_DRAW,
1008 gls::DrawTestSpec::USAGE_STREAM_READ,
1009 gls::DrawTestSpec::USAGE_STREAM_COPY,
1010 gls::DrawTestSpec::USAGE_STATIC_READ,
1011 gls::DrawTestSpec::USAGE_STATIC_COPY,
1012 gls::DrawTestSpec::USAGE_DYNAMIC_READ,
1013 gls::DrawTestSpec::USAGE_DYNAMIC_COPY,
1030 gls::DrawTestSpec spec;
1033 spec.primitive = random.chooseWeighted<gls::DrawTestSpec::Primitive> (DE_ARRAY_BEGIN(primitives), DE_ARRAY_END(primitives), primitiveWeights.weights);
1035 spec.drawMethod = random.chooseWeighted<gls::DrawTestSpec::DrawMethod> (DE_ARRAY_BEGIN(drawMethods), DE_ARRAY_END(drawMethods), drawMethodWeights.weights);
1036 spec.indexType = random.chooseWeighted<gls::DrawTestSpec::IndexType> (DE_ARRAY_BEGIN(indexTypes), DE_ARRAY_END(indexTypes), indexTypeWeights.weights);
1038 spec.indexStorage = random.chooseWeighted<gls::DrawTestSpec::Storage> (DE_ARRAY_BEGIN(storages), DE_ARRAY_END(storages), storageWeights.weights);
1051 gls::DrawTestSpec::AttributeSpec attribSpec;
1053 attribSpec.inputType = random.chooseWeighted<gls::DrawTestSpec::InputType> (DE_ARRAY_BEGIN(inputTypes), DE_ARRAY_END(inputTypes), inputTypeWeights.weights);
1054 attribSpec.outputType = random.chooseWeighted<gls::DrawTestSpec::OutputType> (DE_ARRAY_BEGIN(outputTypes), DE_ARRAY_END(outputTypes), outputTypeWeights.weights);
1055 attribSpec.storage = random.chooseWeighted<gls::DrawTestSpec::Storage> (DE_ARRAY_BEGIN(storages), DE_ARRAY_END(storages), storageWeights.weights);
1056 attribSpec.usage = random.chooseWeighted<gls::DrawTestSpec::Usage> (DE_ARRAY_BEGIN(usages), DE_ARRAY_END(usages), usageWeights.weights);
1068 if (attribSpec.stride && attribSpec.componentCount * gls::DrawTestSpec::inputTypeSize(attribSpec.inputType) > attribSpec.stride)
1080 if (spec.primitive != gls::DrawTestSpec::PRIMITIVE_POINTS)
1086 if (spec.drawMethod == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED && spec.indexMin == spec.indexMax && spec.primitive != gls::DrawTestSpec::PRIMITIVE_POINTS)
1088 if (spec.attribs[0].useDefaultAttribute && spec.primitive != gls::DrawTestSpec::PRIMITIVE_POINTS)
1092 if (spec.primitive == gls::DrawTestSpec::PRIMITIVE_TRIANGLES || spec.primitive == gls::DrawTestSpec::PRIMITIVE_TRIANGLE_FAN || spec.primitive == gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP)
1096 if (spec.attribs[0].outputType == gls::DrawTestSpec::OUTPUTTYPE_FLOAT || spec.attribs[0].outputType == gls::DrawTestSpec::OUTPUTTYPE_INT || spec.attribs[0].outputType == gls::DrawTestSpec::OUTPUTTYPE_UINT)
1098 if (spec.drawMethod == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED && (spec.indexMax - spec.indexMin) < 2)
1112 if (spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET &&
1113 spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE &&
1141 const gls::DrawTestSpec::DrawMethod basicMethods[] =
1143 gls::DrawTestSpec::DRAWMETHOD_DRAWARRAYS,
1144 gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS,
1145 gls::DrawTestSpec::DRAWMETHOD_DRAWARRAYS_INSTANCED,
1146 gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED,
1147 gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED,
1152 const std::string name = gls::DrawTestSpec::drawMethodToString(basicMethods[ndx]);
1153 const std::string desc = gls::DrawTestSpec::drawMethodToString(basicMethods[ndx]);