Home | History | Annotate | Download | only in glshared

Lines Matching refs:DrawTestSpec

78 static GLenum targetToGL (DrawTestSpec::Target target)
86 return de::getSizedArrayElement<DrawTestSpec::TARGET_LAST>(targets, (int)target);
89 static GLenum usageToGL (DrawTestSpec::Usage usage)
107 return de::getSizedArrayElement<DrawTestSpec::USAGE_LAST>(usages, (int)usage);
110 static GLenum inputTypeToGL (DrawTestSpec::InputType type)
129 return de::getSizedArrayElement<DrawTestSpec::INPUTTYPE_LAST>(types, (int)type);
132 static std::string outputTypeToGLType (DrawTestSpec::OutputType type)
153 return de::getSizedArrayElement<DrawTestSpec::OUTPUTTYPE_LAST>(types, (int)type);
156 static GLenum primitiveToGL (DrawTestSpec::Primitive primitive)
173 return de::getSizedArrayElement<DrawTestSpec::PRIMITIVE_LAST>(primitives, (int)primitive);
176 static deUint32 indexTypeToGL (DrawTestSpec::IndexType indexType)
185 return de::getSizedArrayElement<DrawTestSpec::INDEXTYPE_LAST>(indexTypes, (int)indexType);
188 static bool inputTypeIsFloatType (DrawTestSpec::InputType type)
190 if (type == DrawTestSpec::INPUTTYPE_FLOAT)
192 if (type == DrawTestSpec::INPUTTYPE_FIXED)
194 if (type == DrawTestSpec::INPUTTYPE_HALF)
196 if (type == DrawTestSpec::INPUTTYPE_DOUBLE)
201 static bool outputTypeIsFloatType (DrawTestSpec::OutputType type)
203 if (type == DrawTestSpec::OUTPUTTYPE_FLOAT
204 || type == DrawTestSpec::OUTPUTTYPE_VEC2
205 || type == DrawTestSpec::OUTPUTTYPE_VEC3
206 || type == DrawTestSpec::OUTPUTTYPE_VEC4)
212 static bool outputTypeIsIntType (DrawTestSpec::OutputType type)
214 if (type == DrawTestSpec::OUTPUTTYPE_INT
215 || type == DrawTestSpec::OUTPUTTYPE_IVEC2
216 || type == DrawTestSpec::OUTPUTTYPE_IVEC3
217 || type == DrawTestSpec::OUTPUTTYPE_IVEC4)
223 static bool outputTypeIsUintType (DrawTestSpec::OutputType type)
225 if (type == DrawTestSpec::OUTPUTTYPE_UINT
226 || type == DrawTestSpec::OUTPUTTYPE_UVEC2
227 || type == DrawTestSpec::OUTPUTTYPE_UVEC3
228 || type == DrawTestSpec::OUTPUTTYPE_UVEC4)
234 static size_t getElementCount (DrawTestSpec::Primitive primitive, size_t primitiveCount)
238 case DrawTestSpec::PRIMITIVE_POINTS: return primitiveCount;
239 case DrawTestSpec::PRIMITIVE_TRIANGLES: return primitiveCount * 3;
240 case DrawTestSpec::PRIMITIVE_TRIANGLE_FAN: return primitiveCount + 2;
241 case DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP: return primitiveCount + 2;
242 case DrawTestSpec::PRIMITIVE_LINES: return primitiveCount * 2;
243 case DrawTestSpec::PRIMITIVE_LINE_STRIP: return primitiveCount + 1;
244 case DrawTestSpec::PRIMITIVE_LINE_LOOP: return (primitiveCount==1) ? (2) : (primitiveCount);
245 case DrawTestSpec::PRIMITIVE_LINES_ADJACENCY: return primitiveCount * 4;
246 case DrawTestSpec::PRIMITIVE_LINE_STRIP_ADJACENCY: return primitiveCount + 3;
247 case DrawTestSpec::PRIMITIVE_TRIANGLES_ADJACENCY: return primitiveCount * 6;
248 case DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP_ADJACENCY: return primitiveCount * 2 + 4;
265 static MethodInfo getMethodInfo (gls::DrawTestSpec::DrawMethod method)
282 return de::getSizedArrayElement<DrawTestSpec::DRAWMETHOD_LAST>(infos, (int)method);
291 static bool checkSpecsShaderCompatible (const DrawTestSpec& a, const DrawTestSpec& b)
499 GLValue (void) : type(DrawTestSpec::INPUTTYPE_LAST) {}
500 explicit GLValue (Float value) : type(DrawTestSpec::INPUTTYPE_FLOAT), fl(value) {}
501 explicit GLValue (Fixed value) : type(DrawTestSpec::INPUTTYPE_FIXED), fi(value) {}
502 explicit GLValue (Byte value) : type(DrawTestSpec::INPUTTYPE_BYTE), b(value) {}
503 explicit GLValue (Ubyte value) : type(DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE), ub(value) {}
504 explicit GLValue (Short value) : type(DrawTestSpec::INPUTTYPE_SHORT), s(value) {}
505 explicit GLValue (Ushort value) : type(DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT), us(value) {}
506 explicit GLValue (Int value) : type(DrawTestSpec::INPUTTYPE_INT), i(value) {}
507 explicit GLValue (Uint value) : type(DrawTestSpec::INPUTTYPE_UNSIGNED_INT), ui(value) {}
508 explicit GLValue (Half value) : type(DrawTestSpec::INPUTTYPE_HALF), h(value) {}
509 explicit GLValue (Double value) : type(DrawTestSpec::INPUTTYPE_DOUBLE), d(value) {}
513 static GLValue getMaxValue (DrawTestSpec::InputType type);
514 static GLValue getMinValue (DrawTestSpec::InputType type);
516 DrawTestSpec::InputType type;
550 case DrawTestSpec::INPUTTYPE_FLOAT:
554 case DrawTestSpec::INPUTTYPE_BYTE:
558 case DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE:
562 case DrawTestSpec::INPUTTYPE_SHORT:
566 case DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT:
570 case DrawTestSpec::INPUTTYPE_FIXED:
578 case DrawTestSpec::INPUTTYPE_UNSIGNED_INT:
582 case DrawTestSpec::INPUTTYPE_INT:
586 case DrawTestSpec::INPUTTYPE_HALF:
590 case DrawTestSpec::INPUTTYPE_DOUBLE:
601 GLValue GLValue::getMaxValue (DrawTestSpec::InputType type)
603 GLValue rangesHi[(int)DrawTestSpec::INPUTTYPE_LAST];
605 rangesHi[(int)DrawTestSpec::INPUTTYPE_FLOAT] = GLValue(Float::create(127.0f));
606 rangesHi[(int)DrawTestSpec::INPUTTYPE_DOUBLE] = GLValue(Double::create(127.0f));
607 rangesHi[(int)DrawTestSpec::INPUTTYPE_BYTE] = GLValue(Byte::create(127));
608 rangesHi[(int)DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE] = GLValue(Ubyte::create(255));
609 rangesHi[(int)DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT] = GLValue(Ushort::create(65530));
610 rangesHi[(int)DrawTestSpec::INPUTTYPE_SHORT] = GLValue(Short::create(32760));
611 rangesHi[(int)DrawTestSpec::INPUTTYPE_FIXED] = GLValue(Fixed::create(32760));
612 rangesHi[(int)DrawTestSpec::INPUTTYPE_INT] = GLValue(Int::create(2147483647));
613 rangesHi[(int)DrawTestSpec::INPUTTYPE_UNSIGNED_INT] = GLValue(Uint::create(4294967295u));
614 rangesHi[(int)DrawTestSpec::INPUTTYPE_HALF] = GLValue(Half::create(256.0f));
619 GLValue GLValue::getMinValue (DrawTestSpec::InputType type)
621 GLValue rangesLo[(int)DrawTestSpec::INPUTTYPE_LAST];
623 rangesLo[(int)DrawTestSpec::INPUTTYPE_FLOAT] = GLValue(Float::create(-127.0f));
624 rangesLo[(int)DrawTestSpec::INPUTTYPE_DOUBLE] = GLValue(Double::create(-127.0f));
625 rangesLo[(int)DrawTestSpec::INPUTTYPE_BYTE] = GLValue(Byte::create(-127));
626 rangesLo[(int)DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE] = GLValue(Ubyte::create(0));
627 rangesLo[(int)DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT] = GLValue(Ushort::create(0));
628 rangesLo[(int)DrawTestSpec::INPUTTYPE_SHORT] = GLValue(Short::create(-32760));
629 rangesLo[(int)DrawTestSpec::INPUTTYPE_FIXED] = GLValue(Fixed::create(-32760));
630 rangesLo[(int)DrawTestSpec::INPUTTYPE_INT] = GLValue(Int::create(-2147483647));
631 rangesLo[(int)DrawTestSpec::INPUTTYPE_UNSIGNED_INT] = GLValue(Uint::create(0));
632 rangesLo[(int)DrawTestSpec::INPUTTYPE_HALF] = GLValue(Half::create(-256.0f));
640 template<> struct GLValueTypeTraits<GLValue::Float> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_FLOAT; };
641 template<> struct GLValueTypeTraits<GLValue::Double> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_DOUBLE; };
642 template<> struct GLValueTypeTraits<GLValue::Byte> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_BYTE; };
643 template<> struct GLValueTypeTraits<GLValue::Ubyte> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE; };
644 template<> struct GLValueTypeTraits<GLValue::Ushort> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT; };
645 template<> struct GLValueTypeTraits<GLValue::Short> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_SHORT; };
646 template<> struct GLValueTypeTraits<GLValue::Fixed> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_FIXED; };
647 template<> struct GLValueTypeTraits<GLValue::Int> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_INT; };
648 template<> struct GLValueTypeTraits<GLValue::Uint> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_UNSIGNED_INT; };
649 template<> struct GLValueTypeTraits<GLValue::Half> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_HALF; };
893 AttributeArray (DrawTestSpec::Storage storage, sglr::Context& context);
896 void data (DrawTestSpec::Target target, size_t size, const char* data, DrawTestSpec::Usage usage);
897 void setupArray (bool bound, int offset, int size, DrawTestSpec::InputType inType, DrawTestSpec::OutputType outType, bool normalized, int stride, int instanceDivisor, const rr::GenericVec4& defaultAttrib, bool isPositionAttr, bool bgraComponentOrder);
899 void bindIndexArray (DrawTestSpec::Target storage);
902 DrawTestSpec::Target getTarget (void) const { return m_target; }
903 DrawTestSpec::InputType getInputType (void) const { return m_inputType; }
904 DrawTestSpec::OutputType getOutputType (void) const { return m_outputType; }
905 DrawTestSpec::Storage getStorageType (void) const { return m_storage; }
912 DrawTestSpec::Storage m_storage;
920 DrawTestSpec::Target m_target;
921 DrawTestSpec::InputType m_inputType;
922 DrawTestSpec::OutputType m_outputType;
932 AttributeArray::AttributeArray (DrawTestSpec::Storage storage, sglr::Context& context)
940 , m_target (DrawTestSpec::TARGET_ARRAY)
941 , m_inputType (DrawTestSpec::INPUTTYPE_FLOAT)
942 , m_outputType (DrawTestSpec::OUTPUTTYPE_VEC4)
950 if (m_storage == DrawTestSpec::STORAGE_BUFFER)
959 if (m_storage == DrawTestSpec::STORAGE_BUFFER)
964 else if (m_storage == DrawTestSpec::STORAGE_USER)
970 void AttributeArray::data (DrawTestSpec::Target target, size_t size, const char* ptr, DrawTestSpec::Usage usage)
975 if (m_storage == DrawTestSpec::STORAGE_BUFFER)
983 else if (m_storage == DrawTestSpec::STORAGE_USER)
995 void AttributeArray::setupArray (bool bound, int offset, int size, DrawTestSpec::InputType inputType, DrawTestSpec::OutputType outType, bool normalized, int stride, int instanceDivisor, const rr::GenericVec4& defaultAttrib, bool isPositionAttr, bool bgraComponentOrder)
1016 case DrawTestSpec::INPUTTYPE_FLOAT:
1030 case DrawTestSpec::INPUTTYPE_INT:
1036 case DrawTestSpec::INPUTTYPE_UNSIGNED_INT:
1051 if (m_storage == DrawTestSpec::STORAGE_BUFFER)
1058 else if (m_storage == DrawTestSpec::STORAGE_USER)
1105 void AttributeArray::bindIndexArray (DrawTestSpec::Target target)
1107 if (m_storage == DrawTestSpec::STORAGE_USER)
1110 else if (m_storage == DrawTestSpec::STORAGE_BUFFER)
1130 static rr::GenericVecType mapOutputType (const DrawTestSpec::OutputType& type);
1131 static int getComponentCount (const DrawTestSpec::OutputType& type);
1288 case (DrawTestSpec::OUTPUTTYPE_FLOAT):
1289 case (DrawTestSpec::OUTPUTTYPE_INT):
1290 case (DrawTestSpec::OUTPUTTYPE_UINT):
1295 case (DrawTestSpec::OUTPUTTYPE_VEC2):
1296 case (DrawTestSpec::OUTPUTTYPE_IVEC2):
1297 case (DrawTestSpec::OUTPUTTYPE_UVEC2):
1302 case (DrawTestSpec::OUTPUTTYPE_VEC3):
1303 case (DrawTestSpec::OUTPUTTYPE_IVEC3):
1304 case (DrawTestSpec::OUTPUTTYPE_UVEC3):
1310 case (DrawTestSpec::OUTPUTTYPE_VEC4):
1311 case (DrawTestSpec::OUTPUTTYPE_IVEC4):
1312 case (DrawTestSpec::OUTPUTTYPE_UVEC4):
1327 case (DrawTestSpec::OUTPUTTYPE_FLOAT):
1328 case (DrawTestSpec::OUTPUTTYPE_INT):
1329 case (DrawTestSpec::OUTPUTTYPE_UINT):
1334 case (DrawTestSpec::OUTPUTTYPE_VEC2):
1335 case (DrawTestSpec::OUTPUTTYPE_IVEC2):
1336 case (DrawTestSpec::OUTPUTTYPE_UVEC2):
1341 case (DrawTestSpec::OUTPUTTYPE_VEC3):
1342 case (DrawTestSpec::OUTPUTTYPE_IVEC3):
1343 case (DrawTestSpec::OUTPUTTYPE_UVEC3):
1348 case (DrawTestSpec::OUTPUTTYPE_VEC4):
1349 case (DrawTestSpec::OUTPUTTYPE_IVEC4):
1350 case (DrawTestSpec::OUTPUTTYPE_UVEC4):
1433 rr::GenericVecType DrawTestShaderProgram::mapOutputType (const DrawTestSpec::OutputType& type)
1437 case (DrawTestSpec::OUTPUTTYPE_FLOAT):
1438 case (DrawTestSpec::OUTPUTTYPE_VEC2):
1439 case (DrawTestSpec::OUTPUTTYPE_VEC3):
1440 case (DrawTestSpec::OUTPUTTYPE_VEC4):
1443 case (DrawTestSpec::OUTPUTTYPE_INT):
1444 case (DrawTestSpec::OUTPUTTYPE_IVEC2):
1445 case (DrawTestSpec::OUTPUTTYPE_IVEC3):
1446 case (DrawTestSpec::OUTPUTTYPE_IVEC4):
1449 case (DrawTestSpec::OUTPUTTYPE_UINT):
1450 case (DrawTestSpec::OUTPUTTYPE_UVEC2):
1451 case (DrawTestSpec::OUTPUTTYPE_UVEC3):
1452 case (DrawTestSpec::OUTPUTTYPE_UVEC4):
1461 int DrawTestShaderProgram::getComponentCount (const DrawTestSpec::OutputType& type)
1465 case (DrawTestSpec::OUTPUTTYPE_FLOAT):
1466 case (DrawTestSpec::OUTPUTTYPE_INT):
1467 case (DrawTestSpec::OUTPUTTYPE_UINT):
1470 case (DrawTestSpec::OUTPUTTYPE_VEC2):
1471 case (DrawTestSpec::OUTPUTTYPE_IVEC2):
1472 case (DrawTestSpec::OUTPUTTYPE_UVEC2):
1475 case (DrawTestSpec::OUTPUTTYPE_VEC3):
1476 case (DrawTestSpec::OUTPUTTYPE_IVEC3):
1477 case (DrawTestSpec::OUTPUTTYPE_UVEC3):
1480 case (DrawTestSpec::OUTPUTTYPE_VEC4):
1481 case (DrawTestSpec::OUTPUTTYPE_IVEC4):
1482 case (DrawTestSpec::OUTPUTTYPE_UVEC4):
1513 static char* generateArray (int seed, int elementCount, int componentCount, int offset, int stride, DrawTestSpec::InputType type);
1514 static char* generateIndices (int seed, int elementCount, DrawTestSpec::IndexType type, int offset, int min, int max, int indexBase);
1515 static rr::GenericVec4 generateAttributeValue (int seed, DrawTestSpec::InputType type);
1521 static char* generateBasicArray (int seed, int elementCount, int componentCount, int offset, int stride, DrawTestSpec::InputType type);
1527 char* RandomArrayGenerator::generateArray (int seed, int elementCount, int componentCount, int offset, int stride, DrawTestSpec::InputType type)
1529 if (type == DrawTestSpec::INPUTTYPE_INT_2_10_10_10 || type == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10)
1535 char* RandomArrayGenerator::generateBasicArray (int seed, int elementCount, int componentCount, int offset, int stride, DrawTestSpec::InputType type)
1539 case DrawTestSpec::INPUTTYPE_FLOAT: return createBasicArray<float, GLValue::Float> (seed, elementCount, componentCount, offset, stride);
1540 case DrawTestSpec::INPUTTYPE_DOUBLE: return createBasicArray<double, GLValue::Double>(seed, elementCount, componentCount, offset, stride);
1541 case DrawTestSpec::INPUTTYPE_SHORT: return createBasicArray<deInt16, GLValue::Short> (seed, elementCount, componentCount, offset, stride);
1542 case DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT: return createBasicArray<deUint16, GLValue::Ushort>(seed, elementCount, componentCount, offset, stride);
1543 case DrawTestSpec::INPUTTYPE_BYTE: return createBasicArray<deInt8, GLValue::Byte> (seed, elementCount, componentCount, offset, stride);
1544 case DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE: return createBasicArray<deUint8, GLValue::Ubyte> (seed, elementCount, componentCount, offset, stride);
1545 case DrawTestSpec::INPUTTYPE_FIXED: return createBasicArray<deInt32, GLValue::Fixed> (seed, elementCount, componentCount, offset, stride);
1546 case DrawTestSpec::INPUTTYPE_INT: return createBasicArray<deInt32, GLValue::Int> (seed, elementCount, componentCount, offset, stride);
1547 case DrawTestSpec::INPUTTYPE_UNSIGNED_INT: return createBasicArray<deUint32, GLValue::Uint> (seed, elementCount, componentCount, offset, stride);
1548 case DrawTestSpec::INPUTTYPE_HALF: return createBasicArray<deFloat16, GLValue::Half> (seed, elementCount, componentCount, offset, stride);
1649 char* RandomArrayGenerator::generateIndices (int seed, int elementCount, DrawTestSpec::IndexType type, int offset, int min, int max, int indexBase)
1655 case DrawTestSpec::INDEXTYPE_BYTE:
1659 case DrawTestSpec::INDEXTYPE_SHORT:
1663 case DrawTestSpec::INDEXTYPE_INT:
1723 rr::GenericVec4 RandomArrayGenerator::generateAttributeValue (int seed, DrawTestSpec::InputType type)
1729 case DrawTestSpec::INPUTTYPE_FLOAT:
1732 case DrawTestSpec::INPUTTYPE_INT:
1735 case DrawTestSpec::INPUTTYPE_UNSIGNED_INT:
1758 void newArray (DrawTestSpec::Storage storage);
1762 void render (DrawTestSpec::Primitive primitive, DrawTestSpec::DrawMethod drawMethod, int firstVertex, int vertexCount, DrawTestSpec::IndexType indexType, const void* indexOffset, int rangeStart, int rangeEnd, int instanceCount, int indirectOffset, int baseVertex, float coordScale, float colorScale, AttributeArray* indexArray);
1818 void AttributePack::newArray (DrawTestSpec::Storage storage)
1841 void AttributePack::render (DrawTestSpec::Primitive primitive, DrawTestSpec::DrawMethod drawMethod, int firstVertex, int vertexCount, DrawTestSpec::IndexType indexType, const void* indexOffset, int rangeStart, int rangeEnd, int instanceCount, int indirectOffset, int baseVertex, float coordScale, float colorScale, AttributeArray* indexArray)
1860 indexArray->bindIndexArray(DrawTestSpec::TARGET_ELEMENT_ARRAY);
1878 if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWARRAYS)
1883 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWARRAYS_INSTANCED)
1888 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS)
1893 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED)
1898 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED)
1903 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWARRAYS_INDIRECT)
1948 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INDIRECT)
1964 DE_ASSERT(((const deUint8*)indexOffset - (const deUint8*)DE_NULL) % gls::DrawTestSpec::indexTypeSize(indexType) == 0); // \note This is checked in spec validation
1968 command.firstIndex = (glw::GLuint)(((const deUint8*)indexOffset - (const deUint8*)DE_NULL) / gls::DrawTestSpec::indexTypeSize(indexType));
1999 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_BASEVERTEX)
2004 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED_BASEVERTEX)
2009 else if (drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED_BASEVERTEX)
2038 // DrawTestSpec
2040 DrawTestSpec::AttributeSpec DrawTestSpec::AttributeSpec::createAttributeArray (InputType inputType, OutputType outputType, Storage storage, Usage usage, int componentCount, int offset, int stride, bool normalize, int instanceDivisor)
2042 DrawTestSpec::AttributeSpec spec;
2059 DrawTestSpec::AttributeSpec DrawTestSpec::AttributeSpec::createDefaultAttribute (InputType inputType, OutputType outputType, int componentCount)
2064 DrawTestSpec::AttributeSpec spec;
2068 spec.storage = DrawTestSpec::STORAGE_LAST;
2069 spec.usage = DrawTestSpec::USAGE_LAST;
2081 DrawTestSpec::AttributeSpec::AttributeSpec (void)
2083 inputType = DrawTestSpec::INPUTTYPE_LAST;
2084 outputType = DrawTestSpec::OUTPUTTYPE_LAST;
2085 storage = DrawTestSpec::STORAGE_LAST;
2086 usage = DrawTestSpec::USAGE_LAST;
2097 int DrawTestSpec::AttributeSpec::hash (void) const
2109 bool DrawTestSpec::AttributeSpec::valid (glu::ApiType ctxType) const
2111 const bool inputTypeFloat = inputType == DrawTestSpec::INPUTTYPE_FLOAT || inputType == DrawTestSpec::INPUTTYPE_FIXED || inputType == DrawTestSpec::INPUTTYPE_HALF;
2112 const bool inputTypeUnsignedInteger = inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE || inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT || inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT || inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10;
2113 const bool inputTypeSignedInteger = inputType == DrawTestSpec::INPUTTYPE_BYTE || inputType == DrawTestSpec::INPUTTYPE_SHORT || inputType == DrawTestSpec::INPUTTYPE_INT || inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10;
2114 const bool inputTypePacked = inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10;
2116 const bool outputTypeFloat = outputType == DrawTestSpec::OUTPUTTYPE_FLOAT || outputType == DrawTestSpec::OUTPUTTYPE_VEC2 || outputType == DrawTestSpec::OUTPUTTYPE_VEC3 || outputType == DrawTestSpec::OUTPUTTYPE_VEC4;
2117 const bool outputTypeSignedInteger = outputType == DrawTestSpec::OUTPUTTYPE_INT || outputType == DrawTestSpec::OUTPUTTYPE_IVEC2 || outputType == DrawTestSpec::OUTPUTTYPE_IVEC3 || outputType == DrawTestSpec::OUTPUTTYPE_IVEC4;
2118 const bool outputTypeUnsignedInteger = outputType == DrawTestSpec::OUTPUTTYPE_UINT || outputType == DrawTestSpec::OUTPUTTYPE_UVEC2 || outputType == DrawTestSpec::OUTPUTTYPE_UVEC3 || outputType == DrawTestSpec::OUTPUTTYPE_UVEC4;
2122 if (inputType != DrawTestSpec::INPUTTYPE_INT && inputType != DrawTestSpec::INPUTTYPE_UNSIGNED_INT && inputType != DrawTestSpec::INPUTTYPE_FLOAT)
2125 if (inputType != DrawTestSpec::INPUTTYPE_FLOAT && componentCount != 4)
2129 if (inputType == DrawTestSpec::INPUTTYPE_INT && !outputTypeSignedInteger)
2131 if (inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT && !outputTypeUnsignedInteger)
2163 if (bgraComponentOrder && inputType != DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10 && inputType != DrawTestSpec::INPUTTYPE_INT_2_10_10_10 && inputType != DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE)
2171 if (inputType != DrawTestSpec::INPUTTYPE_FLOAT && inputType != DrawTestSpec::INPUTTYPE_FIXED &&
2172 inputType != DrawTestSpec::INPUTTYPE_BYTE && inputType != DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE &&
2173 inputType != DrawTestSpec::INPUTTYPE_SHORT && inputType != DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT)
2193 if (!useDefaultAttribute && storage == DrawTestSpec::STORAGE_USER)
2200 bool DrawTestSpec::AttributeSpec::isBufferAligned (void) const
2202 const bool inputTypePacked = inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10;
2207 int dataTypeSize = gls::DrawTestSpec::inputTypeSize(inputType);
2218 bool DrawTestSpec::AttributeSpec::isBufferStrideAligned (void) const
2220 const bool inputTypePacked = inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10;
2225 int dataTypeSize = gls::DrawTestSpec::inputTypeSize(inputType);
2236 std::string DrawTestSpec::targetToString(Target target)
2244 return de::getSizedArrayElement<DrawTestSpec::TARGET_LAST>(targets, (int)target);
2247 std::string DrawTestSpec::inputTypeToString(InputType type)
2268 return de::getSizedArrayElement<DrawTestSpec::INPUTTYPE_LAST>(types, (int)type);
2271 std::string DrawTestSpec::outputTypeToString(OutputType type)
2292 return de::getSizedArrayElement<DrawTestSpec::OUTPUTTYPE_LAST>(types, (int)type);
2295 std::string DrawTestSpec::usageTypeToString(Usage usage)
2313 return de::getSizedArrayElement<DrawTestSpec::USAGE_LAST>(usages, (int)usage);
2316 std::string DrawTestSpec::storageToString (Storage storage)
2324 return de::getSizedArrayElement<DrawTestSpec::STORAGE_LAST>(storages, (int)storage);
2327 std::string DrawTestSpec::primitiveToString (Primitive primitive)
2344 return de::getSizedArrayElement<DrawTestSpec::PRIMITIVE_LAST>(primitives, (int)primitive);
2347 std::string DrawTestSpec::indexTypeToString (IndexType type)
2356 return de::getSizedArrayElement<DrawTestSpec::INDEXTYPE_LAST>(indexTypes, (int)type);
2359 std::string DrawTestSpec::drawMethodToString (DrawTestSpec::DrawMethod method)
2375 return de::getSizedArrayElement<DrawTestSpec::DRAWMETHOD_LAST>(methods, (int)method);
2378 int DrawTestSpec::inputTypeSize (InputType type)
2399 return de::getSizedArrayElement<DrawTestSpec::INPUTTYPE_LAST>(size, (int)type);
2402 int DrawTestSpec::indexTypeSize (IndexType type)
2411 return de::getSizedArrayElement<DrawTestSpec::INDEXTYPE_LAST>(size, (int)type);
2414 std::string DrawTestSpec::getName (void) const
2440 << DrawTestSpec::inputTypeToString((DrawTestSpec::InputType)attrib.inputType) << "_"
2442 << DrawTestSpec::outputTypeToString(attrib.outputType) << "_";
2447 << DrawTestSpec::storageToString(attrib.storage) << "_"
2450 << DrawTestSpec::inputTypeToString((DrawTestSpec::InputType)attrib.inputType);
2451 if (attrib.inputType != DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10 && attrib.inputType != DrawTestSpec::INPUTTYPE_INT_2_10_10_10)
2456 << DrawTestSpec::outputTypeToString(attrib.outputType) << "_"
2457 << DrawTestSpec::usageTypeToString(attrib.usage) << "_"
2464 DrawTestSpec::indexTypeToString(indexType) << "_"
2465 << DrawTestSpec::storageToString(indexStorage) << "_"
2476 case DrawTestSpec::PRIMITIVE_POINTS:
2479 case DrawTestSpec::PRIMITIVE_TRIANGLES:
2482 case DrawTestSpec::PRIMITIVE_TRIANGLE_FAN:
2485 case DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP:
2488 case DrawTestSpec::PRIMITIVE_LINES:
2491 case DrawTestSpec::PRIMITIVE_LINE_STRIP:
2494 case DrawTestSpec::PRIMITIVE_LINE_LOOP:
2497 case DrawTestSpec::PRIMITIVE_LINES_ADJACENCY:
2500 case DrawTestSpec::PRIMITIVE_LINE_STRIP_ADJACENCY:
2503 case DrawTestSpec::PRIMITIVE_TRIANGLES_ADJACENCY:
2506 case DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP_ADJACENCY:
2519 std::string DrawTestSpec::getDesc (void) const
2531 << "input datatype " << DrawTestSpec::inputTypeToString((DrawTestSpec::InputType)attrib.inputType) << ", "
2533 << "used as " << DrawTestSpec::outputTypeToString(attrib.outputType) << ", ";
2539 << "Storage in " << DrawTestSpec::storageToString(attrib.storage) << ", "
2541 << "input datatype " << DrawTestSpec::inputTypeToString((DrawTestSpec::InputType)attrib.inputType) << ", "
2544 << "used as " << DrawTestSpec::outputTypeToString(attrib.outputType) << ", "
2566 << "index type " << DrawTestSpec::indexTypeToString(indexType) << ", "
2567 << "index storage in " << DrawTestSpec::storageToString(indexStorage) << ", "
2574 << "index type " << DrawTestSpec::indexTypeToString(indexType) << ", "
2575 << "index storage in " << DrawTestSpec::storageToString(indexStorage) << ", "
2584 << "index type " << DrawTestSpec::indexTypeToString(indexType) << ", "
2585 << "index storage in " << DrawTestSpec::storageToString(indexStorage) << ", "
2601 << "index type " << DrawTestSpec::indexTypeToString(indexType) << ", "
2602 << "index storage in " << DrawTestSpec::storageToString(indexStorage) << ", "
2615 case DrawTestSpec::PRIMITIVE_POINTS:
2618 case DrawTestSpec::PRIMITIVE_TRIANGLES:
2621 case DrawTestSpec::PRIMITIVE_TRIANGLE_FAN:
2624 case DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP:
2627 case DrawTestSpec::PRIMITIVE_LINES:
2630 case DrawTestSpec::PRIMITIVE_LINE_STRIP:
2633 case DrawTestSpec::PRIMITIVE_LINE_LOOP:
2636 case DrawTestSpec::PRIMITIVE_LINES_ADJACENCY:
2639 case DrawTestSpec::PRIMITIVE_LINE_STRIP_ADJACENCY:
2642 case DrawTestSpec::PRIMITIVE_TRIANGLES_ADJACENCY:
2645 case DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP_ADJACENCY:
2656 std::string DrawTestSpec::getMultilineDesc (void) const
2668 << "\tinput datatype " << DrawTestSpec::inputTypeToString((DrawTestSpec::InputType)attrib.inputType) << "\n"
2670 << "\tused as " << DrawTestSpec::outputTypeToString(attrib.outputType) << "\n";
2676 << "\tStorage in " << DrawTestSpec::storageToString(attrib.storage) << "\n"
2678 << "\tinput datatype " << DrawTestSpec::inputTypeToString((DrawTestSpec::InputType)attrib.inputType) << "\n"
2681 << "\tused as " << DrawTestSpec::outputTypeToString(attrib.outputType) << "\n"
2703 << "\tindex type " << DrawTestSpec::indexTypeToString(indexType) << "\n"
2704 << "\tindex storage in " << DrawTestSpec::storageToString(indexStorage) << "\n"
2711 << "\tindex type " << DrawTestSpec::indexTypeToString(indexType) << "\n"
2712 << "\tindex storage in " << DrawTestSpec::storageToString(indexStorage) << "\n"
2721 << "\tindex type " << DrawTestSpec::indexTypeToString(indexType) << "\n"
2722 << "\tindex storage in " << DrawTestSpec::storageToString(indexStorage) << "\n"
2738 << "\tindex type " << DrawTestSpec::indexTypeToString(indexType) << "\n"
2739 << "\tindex storage in " << DrawTestSpec::storageToString(indexStorage) << "\n"
2749 << "\tindex type " << DrawTestSpec::indexTypeToString(indexType) << "\n"
2750 << "\tindex storage in " << DrawTestSpec::storageToString(indexStorage) << "\n"
2758 << "\tindex type " << DrawTestSpec::indexTypeToString(indexType) << "\n"
2759 << "\tindex storage in " << DrawTestSpec::storageToString(indexStorage) << "\n"
2768 << "\tindex type " << DrawTestSpec::indexTypeToString(indexType) << "\n"
2769 << "\tindex storage in " << DrawTestSpec::storageToString(indexStorage) << "\n"
2782 case DrawTestSpec::PRIMITIVE_POINTS:
2785 case DrawTestSpec::PRIMITIVE_TRIANGLES:
2788 case DrawTestSpec::PRIMITIVE_TRIANGLE_FAN:
2791 case DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP:
2794 case DrawTestSpec::PRIMITIVE_LINES:
2797 case DrawTestSpec::PRIMITIVE_LINE_STRIP:
2800 case DrawTestSpec::PRIMITIVE_LINE_LOOP:
2803 case DrawTestSpec::PRIMITIVE_LINES_ADJACENCY:
2806 case DrawTestSpec::PRIMITIVE_LINE_STRIP_ADJACENCY:
2809 case DrawTestSpec::PRIMITIVE_TRIANGLES_ADJACENCY:
2812 case DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP_ADJACENCY:
2825 DrawTestSpec::DrawTestSpec (void)
2841 int DrawTestSpec::hash (void) const
2863 bool DrawTestSpec::valid (void) const
2901 if (drawMethod != gls::DrawTestSpec::DRAWMETHOD_DRAWARRAYS && drawMethod != gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS)
2903 if (drawMethod == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS && (indexType != INDEXTYPE_BYTE && indexType != INDEXTYPE_SHORT))
2916 if (!attribs[ndx].useDefaultAttribute && attribs[ndx].storage == gls::DrawTestSpec::STORAGE_USER)
2922 if (indexPointerOffset % gls::DrawTestSpec::indexTypeSize(indexType) != 0)
2933 if (methodInfo.indexed && indexStorage == DrawTestSpec::STORAGE_USER)
2940 DrawTestSpec::CompatibilityTestType DrawTestSpec::isCompatibilityTest (void) const
2995 static PrimitiveClass getDrawPrimitiveClass (gls::DrawTestSpec::Primitive primitiveType)
2999 case gls::DrawTestSpec::PRIMITIVE_POINTS:
3002 case gls::DrawTestSpec::PRIMITIVE_LINES:
3003 case gls::DrawTestSpec::PRIMITIVE_LINE_STRIP:
3004 case gls::DrawTestSpec::PRIMITIVE_LINE_LOOP:
3005 case gls::DrawTestSpec::PRIMITIVE_LINES_ADJACENCY:
3006 case gls::DrawTestSpec::PRIMITIVE_LINE_STRIP_ADJACENCY:
3009 case gls::DrawTestSpec::PRIMITIVE_TRIANGLES:
3010 case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_FAN:
3011 case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP:
3012 case gls::DrawTestSpec::PRIMITIVE_TRIANGLES_ADJACENCY:
3013 case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP_ADJACENCY:
3022 static bool containsLineCases (const std::vector<DrawTestSpec>& m_specs)
3034 DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const DrawTestSpec& spec, const char* name, const char* desc)
3072 void DrawTest::addIteration (const DrawTestSpec& spec, const char* description)
3156 const DrawTestSpec& spec = m_specs[specNdx];
3193 DrawTestSpec::AttributeSpec attribSpec = spec.attribs[attribNdx];
3201 m_glArrayPack->newArray(DrawTestSpec::STORAGE_USER);
3202 m_rrArrayPack->newArray(DrawTestSpec::STORAGE_USER);
3210 const size_t elementSize = attribSpec.componentCount * DrawTestSpec::inputTypeSize(attribSpec.inputType);
3222 m_glArrayPack->getArray(attribNdx)->data(DrawTestSpec::TARGET_ARRAY, bufferSize, data, attribSpec.usage);
3223 m_rrArrayPack->getArray(attribNdx)->data(DrawTestSpec::TARGET_ARRAY, bufferSize, data, attribSpec.usage);
3253 const size_t indexElementSize = DrawTestSpec::indexTypeSize(spec.indexType);
3256 const char* indexPointerBase = (spec.indexStorage == DrawTestSpec::STORAGE_USER) ? (indexArray) : ((char*)DE_NULL);
3264 glArray->data(DrawTestSpec::TARGET_ELEMENT_ARRAY, indexArraySize, indexArray, DrawTestSpec::USAGE_STATIC_DRAW);
3265 rrArray->data(DrawTestSpec::TARGET_ELEMENT_ARRAY, indexArraySize, indexArray, DrawTestSpec::USAGE_STATIC_DRAW);
3281 m_glArrayPack->render(spec.primitive, spec.drawMethod, spec.first, (int)primitiveElementCount, DrawTestSpec::INDEXTYPE_LAST, DE_NULL, 0, 0, spec.instanceCount, spec.indirectOffset, 0, coordScale, colorScale, DE_NULL);
3282 m_rrArrayPack->render(spec.primitive, spec.drawMethod, spec.first, (int)primitiveElementCount, DrawTestSpec::INDEXTYPE_LAST, DE_NULL, 0, 0, spec.instanceCount, spec.indirectOffset, 0, coordScale, colorScale, DE_NULL);
3289 const DrawTestSpec::CompatibilityTestType ctype = spec.isCompatibilityTest();
3293 if (ctype == DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET)
3295 else if (ctype == DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE)
3305 const DrawTestSpec::CompatibilityTestType ctype = spec.isCompatibilityTest();
3307 if (ctype == DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET)
3309 else if (ctype == DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE)
3675 bool DrawTest::compare (gls::DrawTestSpec::Primitive primitiveType)
3750 float DrawTest::getCoordScale (const DrawTestSpec& spec) const
3756 DrawTestSpec::AttributeSpec attribSpec = spec.attribs[arrayNdx];
3763 if (attribSpec.inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10)
3770 else if (attribSpec.inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10)
3784 if (attribSpec.outputType == DrawTestSpec::OUTPUTTYPE_VEC3 || attribSpec.outputType == DrawTestSpec::OUTPUTTYPE_VEC4
3785 || attribSpec.outputType == DrawTestSpec::OUTPUTTYPE_IVEC3 || attribSpec.outputType == DrawTestSpec::OUTPUTTYPE_IVEC4
3786 DrawTestSpec::OUTPUTTYPE_UVEC3 || attribSpec.outputType == DrawTestSpec::OUTPUTTYPE_UVEC4)
3795 float DrawTest::getColorScale (const DrawTestSpec& spec) const
3801 DrawTestSpec::AttributeSpec attribSpec = spec.attribs[arrayNdx];
3807 if (attribSpec.inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10)
3812 else if (attribSpec.inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10)
3822 if (attribSpec.outputType == DrawTestSpec::OUTPUTTYPE_VEC4 ||
3823 attribSpec.outputType == DrawTestSpec::OUTPUTTYPE_UVEC4 ||
3824 attribSpec.outputType == DrawTestSpec::OUTPUTTYPE_IVEC4)