Lines Matching defs:const
76 const int MAX_RENDER_TARGET_SIZE = 512;
82 static const GLenum targets[] =
93 static const GLenum usages[] =
114 static const GLenum types[] =
136 static const char* types[] =
160 static const GLenum primitives[] =
180 static const GLenum indexTypes[] =
269 static const MethodInfo infos[] =
293 static bool checkSpecsShaderCompatible (const DrawTestSpec& a, const DrawTestSpec& b)
357 IterationLogSectionEmitter (tcu::TestLog& log, size_t testIteration, size_t testIterations, const std::string& description, bool enabled);
360 IterationLogSectionEmitter (const IterationLogSectionEmitter&); // delete
361 IterationLogSectionEmitter& operator= (const IterationLogSectionEmitter&); // delete
367 IterationLogSectionEmitter::IterationLogSectionEmitter (tcu::TestLog& log, size_t testIteration, size_t testIterations, const std::string& description, bool enabled)
400 inline Type getValue (void) const { return m_value; }
402 inline WrappedType<Type> operator+ (const WrappedType<Type>& other) const { return WrappedType<Type>::create((Type)(m_value + other.getValue())); }
403 inline WrappedType<Type> operator* (const WrappedType<Type>& other) const { return WrappedType<Type>::create((Type)(m_value * other.getValue())); }
404 inline WrappedType<Type> operator/ (const WrappedType<Type>& other) const { return WrappedType<Type>::create((Type)(m_value / other.getValue())); }
405 inline WrappedType<Type> operator- (const WrappedType<Type>& other) const { return WrappedType<Type>::create((Type)(m_value - other.getValue())); }
407 inline WrappedType<Type>& operator+= (const WrappedType<Type>& other) { m_value += other.getValue(); return *this; }
408 inline WrappedType<Type>& operator*= (const WrappedType<Type>& other) { m_value *= other.getValue(); return *this; }
409 inline WrappedType<Type>& operator/= (const WrappedType<Type>& other) { m_value /= other.getValue(); return *this; }
410 inline WrappedType<Type>& operator-= (const WrappedType<Type>& other) { m_value -= other.getValue(); return *this; }
412 inline bool operator== (const WrappedType<Type>& other) const { return m_value == other.m_value; }
413 inline bool operator!= (const WrappedType<Type>& other) const { return m_value != other.m_value; }
414 inline bool operator< (const WrappedType<Type>& other) const { return m_value < other.m_value; }
415 inline bool operator> (const WrappedType<Type>& other) const { return m_value > other.m_value; }
416 inline bool operator<= (const WrappedType<Type>& other) const { return m_value <= other.m_value; }
417 inline bool operator>= (const WrappedType<Type>& other) const { return m_value >= other.m_value; }
419 inline operator Type (void) const { return m_value; }
421 inline T to (void) const { return (T)m_value; }
442 inline deInt32 getValue (void) const { return m_value; }
444 inline Int operator+ (const Int& other) const { return Int::create((deInt32)((deInt64)m_value + (deInt64)other.getValue())); }
445 inline Int operator* (const Int& other) const { return Int::create((deInt32)((deInt64)m_value * (deInt64)other.getValue())); }
446 inline Int operator/ (const Int& other) const { return Int::create((deInt32)((deInt64)m_value / (deInt64)other.getValue())); }
447 inline Int operator- (const Int& other) const { return Int::create((deInt32)((deInt64)m_value - (deInt64)other.getValue())); }
449 inline Int& operator+= (const Int& other) { m_value = (deInt32)((deInt64)m_value + (deInt64)other.getValue()); return *this; }
450 inline Int& operator*= (const Int& other) { m_value = (deInt32)((deInt64)m_value * (deInt64)other.getValue()); return *this; }
451 inline Int& operator/= (const Int& other) { m_value = (deInt32)((deInt64)m_value / (deInt64)other.getValue()); return *this; }
452 inline Int& operator-= (const Int& other) { m_value = (deInt32)((deInt64)m_value - (deInt64)other.getValue()); return *this; }
454 inline bool operator== (const Int& other) const { return m_value == other.m_value; }
455 inline bool operator!= (const Int& other) const { return m_value != other.m_value; }
456 inline bool operator< (const Int& other) const { return m_value < other.m_value; }
457 inline bool operator> (const Int& other) const { return m_value > other.m_value; }
458 inline bool operator<= (const Int& other) const { return m_value <= other.m_value; }
459 inline bool operator>= (const Int& other) const { return m_value >= other.m_value; }
461 inline operator deInt32 (void) const { return m_value; }
463 inline T to (void) const { return (T)m_value; }
472 inline deFloat16 getValue (void) const { return m_value; }
474 inline Half operator+ (const Half& other) const { return create(halfToFloat(m_value) + halfToFloat(other.getValue())); }
475 inline Half operator* (const Half& other) const { return create(halfToFloat(m_value) * halfToFloat(other.getValue())); }
476 inline Half operator/ (const Half& other) const { return create(halfToFloat(m_value) / halfToFloat(other.getValue())); }
477 inline Half operator- (const Half& other) const { return create(halfToFloat(m_value) - halfToFloat(other.getValue())); }
479 inline Half& operator+= (const Half& other) { m_value = floatToHalf(halfToFloat(other.getValue()) + halfToFloat(m_value)); return *this; }
480 inline Half& operator*= (const Half& other) { m_value = floatToHalf(halfToFloat(other.getValue()) * halfToFloat(m_value)); return *this; }
481 inline Half& operator/= (const Half& other) { m_value = floatToHalf(halfToFloat(other.getValue()) / halfToFloat(m_value)); return *this; }
482 inline Half& operator-= (const Half& other) { m_value = floatToHalf(halfToFloat(other.getValue()) - halfToFloat(m_value)); return *this; }
484 inline bool operator== (const Half& other) const { return m_value == other.m_value; }
485 inline bool operator!= (const Half& other) const { return m_value != other.m_value; }
486 inline bool operator< (const Half& other) const { return halfToFloat(m_value) < halfToFloat(other.m_value); }
487 inline bool operator> (const Half& other) const { return halfToFloat(m_value) > halfToFloat(other.m_value); }
488 inline bool operator<= (const Half& other) const { return halfToFloat(m_value) <= halfToFloat(other.m_value); }
489 inline bool operator>= (const Half& other) const { return halfToFloat(m_value) >= halfToFloat(other.m_value); }
492 inline T to (void) const { return (T)halfToFloat(m_value); }
504 inline deInt32 getValue (void) const { return m_value; }
506 inline Fixed operator+ (const Fixed& other) const { return create(m_value + other.getValue()); }
507 inline Fixed operator* (const Fixed& other) const { return create(m_value * other.getValue()); }
508 inline Fixed operator/ (const Fixed& other) const { return create(m_value / other.getValue()); }
509 inline Fixed operator- (const Fixed& other) const { return create(m_value - other.getValue()); }
511 inline Fixed& operator+= (const Fixed& other) { m_value += other.getValue(); return *this; }
512 inline Fixed& operator*= (const Fixed& other) { m_value *= other.getValue(); return *this; }
513 inline Fixed& operator/= (const Fixed& other) { m_value /= other.getValue(); return *this; }
514 inline Fixed& operator-= (const Fixed& other) { m_value -= other.getValue(); return *this; }
516 inline bool operator== (const Fixed& other) const { return m_value == other.m_value; }
517 inline bool operator!= (const Fixed& other) const { return m_value != other.m_value; }
518 inline bool operator< (const Fixed& other) const { return m_value < other.m_value; }
519 inline bool operator> (const Fixed& other) const { return m_value > other.m_value; }
520 inline bool operator<= (const Fixed& other) const { return m_value <= other.m_value; }
521 inline bool operator>= (const Fixed& other) const { return m_value >= other.m_value; }
523 inline operator deInt32 (void) const { return m_value; }
525 inline T to (void) const { return (T)m_value; }
543 float toFloat (void) const;
578 float GLValue::toFloat (void) const
660 template<> struct GLValueTypeTraits<GLValue::Float> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_FLOAT; };
661 template<> struct GLValueTypeTraits<GLValue::Double> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_DOUBLE; };
662 template<> struct GLValueTypeTraits<GLValue::Byte> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_BYTE; };
663 template<> struct GLValueTypeTraits<GLValue::Ubyte> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_UNSIGNED_BYTE; };
664 template<> struct GLValueTypeTraits<GLValue::Ushort> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_UNSIGNED_SHORT; };
665 template<> struct GLValueTypeTraits<GLValue::Short> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_SHORT; };
666 template<> struct GLValueTypeTraits<GLValue::Fixed> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_FIXED; };
667 template<> struct GLValueTypeTraits<GLValue::Int> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_INT; };
668 template<> struct GLValueTypeTraits<GLValue::Uint> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_UNSIGNED_INT; };
669 template<> struct GLValueTypeTraits<GLValue::Half> { static const DrawTestSpec::InputType Type = DrawTestSpec::INPUTTYPE_HALF; };
672 inline T extractGLValue (const GLValue& v);
674 template<> GLValue::Float inline extractGLValue<GLValue::Float> (const GLValue& v) { return v.fl; }
675 template<> GLValue::Double inline extractGLValue<GLValue::Double> (const GLValue& v) { return v.d; }
676 template<> GLValue::Byte inline extractGLValue<GLValue::Byte> (const GLValue& v) { return v.b; }
677 template<> GLValue::Ubyte inline extractGLValue<GLValue::Ubyte> (const GLValue& v) { return v.ub; }
678 template<> GLValue::Ushort inline extractGLValue<GLValue::Ushort> (const GLValue& v) { return v.us; }
679 template<> GLValue::Short inline extractGLValue<GLValue::Short> (const GLValue& v) { return v.s; }
680 template<> GLValue::Fixed inline extractGLValue<GLValue::Fixed> (const GLValue& v) { return v.fi; }
681 template<> GLValue::Int inline extractGLValue<GLValue::Int> (const GLValue& v) { return v.i; }
682 template<> GLValue::Uint inline extractGLValue<GLValue::Uint> (const GLValue& v) { return v.ui; }
683 template<> GLValue::Half inline extractGLValue<GLValue::Half> (const GLValue& v) { return v.h; }
916 void data (DrawTestSpec::Target target, size_t size, const char* data, DrawTestSpec::Usage usage);
917 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);
921 int getComponentCount (void) const { return m_componentCount; }
922 DrawTestSpec::Target getTarget (void) const { return m_target; }
923 DrawTestSpec::InputType getInputType (void) const { return m_inputType; }
924 DrawTestSpec::OutputType getOutputType (void) const { return m_outputType; }
925 DrawTestSpec::Storage getStorageType (void) const { return m_storage; }
926 bool getNormalized (void) const { return m_normalize; }
927 int getStride (void) const { return m_stride; }
928 bool isBound (void) const { return m_bound; }
929 bool isPositionAttribute (void) const { return m_isPositionAttr; }
990 void AttributeArray::data (DrawTestSpec::Target target, size_t size, const char* ptr, DrawTestSpec::Usage usage)
1015 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)
1069 const deUint8* basePtr = DE_NULL;
1083 basePtr = (const deUint8*)m_data;
1094 const int size = (m_bgraOrder) ? (GL_BGRA) : (m_componentCount);
1141 DrawTestShaderProgram (const glu::RenderContext& ctx, const std::vector<AttributeArray*>& arrays);
1143 void shadeVertices (const rr::VertexAttrib* inputs, rr::VertexPacket* const* packets, const int numPackets) const;
1144 void shadeFragments (rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const;
1147 static std::string genVertexSource (const glu::RenderContext& ctx, const std::vector<AttributeArray*>& arrays);
1148 static std::string genFragmentSource (const glu::RenderContext& ctx);
1150 static rr::GenericVecType mapOutputType (const DrawTestSpec::OutputType& type);
1151 static int getComponentCount (const DrawTestSpec::OutputType& type);
1153 static sglr::pdec::ShaderProgramDeclaration createProgramDeclaration (const glu::RenderContext& ctx, const std::vector<AttributeArray*>& arrays);
1160 DrawTestShaderProgram::DrawTestShaderProgram (const glu::RenderContext& ctx, const std::vector<AttributeArray*>& arrays)
1175 void calcShaderColorCoord (tcu::Vec2& coord, tcu::Vec3& color, const tcu::Vector<T, 4>& attribValue, bool isCoordinate, int numComponents)
1219 void DrawTestShaderProgram::shadeVertices (const rr::VertexAttrib* inputs, rr::VertexPacket* const* packets, const int numPackets) const
1221 const float u_coordScale = getUniformByName("u_coordScale").value.f;
1222 const float u_colorScale = getUniformByName("u_colorScale").value.f;
1226 const size_t varyingLocColor = 0;
1236 const int numComponents = m_componentCount[attribNdx];
1237 const bool isCoord = m_isCoord[attribNdx];
1262 void DrawTestShaderProgram::shadeFragments (rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const
1264 const size_t varyingLocColor = 0;
1275 std::string DrawTestShaderProgram::genVertexSource (const glu::RenderContext& ctx, const std::vector<AttributeArray*>& arrays)
1302 const bool isPositionAttr = arrays[arrayNdx]->isPositionAttribute();
1390 std::string DrawTestShaderProgram::genFragmentSource (const glu::RenderContext& ctx)
1396 static const char* fragmentShaderTmpl =
1453 rr::GenericVecType DrawTestShaderProgram::mapOutputType (const DrawTestSpec::OutputType& type)
1481 int DrawTestShaderProgram::getComponentCount (const DrawTestSpec::OutputType& type)
1511 sglr::pdec::ShaderProgramDeclaration DrawTestShaderProgram::createProgramDeclaration (const glu::RenderContext& ctx, const std::vector<AttributeArray*>& arrays)
1591 const GLType min = extractGLValue<GLType>(GLValue::getMinValue(GLValueTypeTraits<GLType>::Type));
1592 const GLType max = extractGLValue<GLType>(GLValue::getMaxValue(GLValueTypeTraits<GLType>::Type));
1594 const size_t componentSize = sizeof(T);
1595 const size_t elementSize = componentSize * componentCount;
1596 const size_t bufferSize = offset + (elementCount - 1) * stride + elementSize;
1643 const deUint32 limit10 = (1 << 10);
1644 const deUint32 limit2 = (1 << 2);
1645 const size_t elementSize = 4;
1646 const size_t bufferSize = offset + (elementCount - 1) * stride + elementSize;
1656 const deUint32 x = deRandom_getUint32(&rnd) % limit10;
1657 const deUint32 y = deRandom_getUint32(&rnd) % limit10;
1658 const deUint32 z = deRandom_getUint32(&rnd) % limit10;
1659 const deUint32 w = deRandom_getUint32(&rnd) % limit2;
1660 const deUint32 packedValue = (w << 30) | (z << 20) | (y << 10) | (x);
1698 const size_t elementSize = sizeof(T);
1699 const size_t bufferSize = offset + elementCount * elementSize;
1772 AttributePack (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, sglr::Context& drawContext, const tcu::UVec2& screenSize, bool useVao, bool logEnabled);
1782 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);
1784 const tcu::Surface& getSurface (void) const { return m_screen; }
1793 const bool m_useVao;
1794 const bool m_logEnabled;
1799 AttributePack::AttributePack (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, sglr::Context& drawContext, const tcu::UVec2& screenSize, bool useVao, bool logEnabled)
1861 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)
1984 const auto offsetAsInteger = reinterpret_cast<uintptr_t>(indexOffset);
2118 int DrawTestSpec::AttributeSpec::hash (void) const
2130 bool DrawTestSpec::AttributeSpec::valid (glu::ApiType ctxType) const
2132 const bool inputTypeFloat = inputType == DrawTestSpec::INPUTTYPE_FLOAT || inputType == DrawTestSpec::INPUTTYPE_FIXED || inputType == DrawTestSpec::INPUTTYPE_HALF;
2133 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;
2134 const bool inputTypeSignedInteger = inputType == DrawTestSpec::INPUTTYPE_BYTE || inputType == DrawTestSpec::INPUTTYPE_SHORT || inputType == DrawTestSpec::INPUTTYPE_INT || inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10;
2135 const bool inputTypePacked = inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10;
2137 const bool outputTypeFloat = outputType == DrawTestSpec::OUTPUTTYPE_FLOAT || outputType == DrawTestSpec::OUTPUTTYPE_VEC2 || outputType == DrawTestSpec::OUTPUTTYPE_VEC3 || outputType == DrawTestSpec::OUTPUTTYPE_VEC4;
2138 const bool outputTypeSignedInteger = outputType == DrawTestSpec::OUTPUTTYPE_INT || outputType == DrawTestSpec::OUTPUTTYPE_IVEC2 || outputType == DrawTestSpec::OUTPUTTYPE_IVEC3 || outputType == DrawTestSpec::OUTPUTTYPE_IVEC4;
2139 const bool outputTypeUnsignedInteger = outputType == DrawTestSpec::OUTPUTTYPE_UINT || outputType == DrawTestSpec::OUTPUTTYPE_UVEC2 || outputType == DrawTestSpec::OUTPUTTYPE_UVEC3 || outputType == DrawTestSpec::OUTPUTTYPE_UVEC4;
2221 bool DrawTestSpec::AttributeSpec::isBufferAligned (void) const
2223 const bool inputTypePacked = inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10;
2239 bool DrawTestSpec::AttributeSpec::isBufferStrideAligned (void) const
2241 const bool inputTypePacked = inputType == DrawTestSpec::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || inputType == DrawTestSpec::INPUTTYPE_INT_2_10_10_10;
2259 static const char* targets[] =
2270 static const char* types[] =
2294 static const char* types[] =
2318 static const char* usages[] =
2339 static const char* storages[] =
2350 static const char* primitives[] =
2370 static const char* indexTypes[] =
2382 static const char* methods[] =
2401 static const int size[] =
2425 static const int size[] =
2435 std::string DrawTestSpec::getName (void) const
2437 const MethodInfo methodInfo = getMethodInfo(drawMethod);
2438 const bool hasFirst = methodInfo.first;
2439 const bool instanced = methodInfo.instanced;
2440 const bool ranged = methodInfo.ranged;
2441 const bool indexed = methodInfo.indexed;
2447 const AttributeSpec& attrib = attribs[ndx];
2540 std::string DrawTestSpec::getDesc (void) const
2546 const AttributeSpec& attrib = attribs[ndx];
2677 std::string DrawTestSpec::getMultilineDesc (void) const
2683 const AttributeSpec& attrib = attribs[ndx];
2862 int DrawTestSpec::hash (void) const
2865 const MethodInfo methodInfo = getMethodInfo(drawMethod);
2866 const bool arrayed = methodInfo.first;
2867 const bool instanced = methodInfo.instanced;
2868 const bool ranged = methodInfo.ranged;
2869 const bool indexed = methodInfo.indexed;
2870 const bool indirect = methodInfo.indirect;
2871 const bool hasBaseVtx = methodInfo.baseVertex;
2873 const int indexHash = (!indexed) ? (0) : (int(indexType) + 10 * indexPointerOffset + 100 * int(indexStorage));
2874 const int arrayHash = (!arrayed) ? (0) : (first);
2875 const int indexRangeHash = (!ranged) ? (0) : (indexMin + 10 * indexMax);
2876 const int instanceHash = (!instanced) ? (0) : (instanceCount);
2877 const int indirectHash = (!indirect) ? (0) : (indirectOffset);
2878 const int baseVtxHash = (!hasBaseVtx) ? (0) : (baseVertex);
2879 const int basicHash = int(primitive) + 10 * primitiveCount + 100 * int(drawMethod);
2884 bool DrawTestSpec::valid (void) const
2890 const MethodInfo methodInfo = getMethodInfo(drawMethod);
2961 DrawTestSpec::CompatibilityTestType DrawTestSpec::isCompatibilityTest (void) const
2963 const MethodInfo methodInfo = getMethodInfo(drawMethod);
3043 static bool containsLineCases (const std::vector<DrawTestSpec>& m_specs)
3055 DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const DrawTestSpec& spec, const char* name, const char* desc)
3073 DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* desc)
3095 void DrawTest::addIteration (const DrawTestSpec& spec, const char* description)
3098 const bool validSpec = spec.valid();
3107 const bool validContext = m_specs[0].apiType == spec.apiType;
3127 const int renderTargetWidth = de::min(MAX_RENDER_TARGET_SIZE, m_renderCtx.getRenderTarget().getWidth());
3128 const int renderTargetHeight = de::min(MAX_RENDER_TARGET_SIZE, m_renderCtx.getRenderTarget().getHeight());
3131 const bool isLineCase = containsLineCases(m_specs);
3132 const bool isMSAACase = m_renderCtx.getRenderTarget().getNumSamples() > 1;
3133 const int renderTargetSamples = (isMSAACase && isLineCase) ? (4) : (1);
3178 const int specNdx = (m_iteration / 2);
3179 const DrawTestSpec& spec = m_specs[specNdx];
3185 const bool supportsES32orGL45 = contextSupports(m_renderCtx.getType(), glu::ApiType::es(3, 2)) ||
3190 const bool drawStep = (m_iteration % 2) == 0;
3191 const bool compareStep = (m_iteration % 2) == 1;
3192 const IterateResult iterateResult = ((size_t)m_iteration + 1 == m_specs.size()*2) ? (STOP) : (CONTINUE);
3193 const bool updateProgram = (m_iteration == 0) || (drawStep && !checkSpecsShaderCompatible(m_specs[specNdx], m_specs[specNdx-1])); // try to use the same shader in all iterations
3198 const MethodInfo methodInfo = getMethodInfo(spec.drawMethod);
3199 const bool indexed = methodInfo.indexed;
3200 const bool instanced = methodInfo.instanced;
3201 const bool ranged = methodInfo.ranged;
3202 const bool hasFirst = methodInfo.first;
3203 const bool hasBaseVtx = methodInfo.baseVertex;
3205 const size_t primitiveElementCount = getElementCount(spec.primitive, spec.primitiveCount); // !< elements to be drawn
3206 const int indexMin = (ranged) ? (spec.indexMin) : (0);
3207 const int firstAddition = (hasFirst) ? (spec.first) : (0);
3208 const int baseVertexAddition = (hasBaseVtx && spec.baseVertex > 0) ? ( spec.baseVertex) : (0); // spec.baseVertex > 0 => Create bigger attribute buffer
3209 const int indexBase = (hasBaseVtx && spec.baseVertex < 0) ? (-spec.baseVertex) : (0); // spec.baseVertex < 0 => Create bigger indices
3210 const size_t elementCount = primitiveElementCount + indexMin + firstAddition + baseVertexAddition; // !< elements in buffer (buffer should have at least primitiveElementCount ACCESSIBLE (index range, first) elements)
3211 const int maxElementIndex = (int)primitiveElementCount + indexMin + firstAddition - 1;
3212 const int indexMax = de::max(0, (ranged) ? (de::clamp<int>(spec.indexMax, 0, maxElementIndex)) : (maxElementIndex));
3230 const bool isPositionAttr = (attribNdx == 0) || (attribSpec.additionalPositionAttribute);
3234 const int seed = 10 * attribSpec.hash() + 100 * spec.hash() + attribNdx;
3245 const int seed = attribSpec.hash() + 100 * spec.hash() + attribNdx;
3246 const size_t elementSize = attribSpec.componentCount * DrawTestSpec::inputTypeSize(attribSpec.inputType);
3247 const size_t stride = (attribSpec.stride == 0) ? (elementSize) : (attribSpec.stride);
3248 const size_t evaluatedElementCount = (instanced && attribSpec.instanceDivisor > 0) ? (spec.instanceCount / attribSpec.instanceDivisor + 1) : (elementCount);
3249 const size_t referencedElementCount = (ranged) ? (de::max<size_t>(evaluatedElementCount, spec.indexMax + 1)) : (evaluatedElementCount);
3250 const size_t bufferSize = attribSpec.offset + stride * (referencedElementCount - 1) + elementSize;
3251 const char* data = RandomArrayGenerator::generateArray(seed, (int)referencedElementCount, attribSpec.componentCount, attribSpec.offset, (int)stride, attribSpec.inputType);
3288 const int seed = spec.hash();
3289 const size_t indexElementSize = DrawTestSpec::indexTypeSize(spec.indexType);
3290 const size_t indexArraySize = spec.indexPointerOffset + indexElementSize * elementCount;
3291 const char* indexArray = RandomArrayGenerator::generateIndices(seed, (int)elementCount, spec.indexType, spec.indexPointerOffset, indexMin, indexMax, indexBase);
3292 const char* indexPointerBase = (spec.indexStorage == DrawTestSpec::STORAGE_USER) ? (indexArray) : ((char*)DE_NULL);
3293 const char* indexPointer = indexPointerBase + spec.indexPointerOffset;
3326 const DrawTestSpec::CompatibilityTestType ctype = spec.isCompatibilityTest();
3342 const DrawTestSpec::CompatibilityTestType ctype = spec.isCompatibilityTest();
3364 static bool isBlack (const tcu::RGBA& c)
3372 const int roundingDifference = 2 * renderTargetDifference; // src and dst pixels rounded to different directions
3373 const int d1 = c2 - c1;
3374 const int d2 = c3 - c2;
3375 const int rampDiff = de::abs(d2 - d1);
3380 static bool isEdgeTriplet (const tcu::RGBA& c1, const tcu::RGBA& c2, const tcu::RGBA& c3, const tcu::IVec3& renderTargetThreshold)
3384 const bool b1 = isBlack(c1);
3385 const bool b2 = isBlack(c2);
3386 const bool b3 = isBlack(c3);
3409 static bool pixelNearEdge (int x, int y, const tcu::Surface& ref, const tcu::IVec3& renderTargetThreshold)
3419 const tcu::RGBA c1 = ref.getPixel(x-1, y+dy);
3420 const tcu::RGBA c2 = ref.getPixel(x, y+dy);
3421 const tcu::RGBA c3 = ref.getPixel(x+1, y+dy);
3430 const tcu::RGBA c1 = ref.getPixel(x+dx, y-1);
3431 const tcu::RGBA c2 = ref.getPixel(x+dx, y);
3432 const tcu::RGBA c3 = ref.getPixel(x+dx, y+1);
3440 static deUint32 getVisualizationGrayscaleColor (const tcu::RGBA& c)
3449 static bool pixelNearLineIntersection (int x, int y, const tcu::Surface& target)
3460 const bool targetCoverage = !isBlack(target.getPixel(x+dx, y+dy));
3474 static inline bool colorsEqual (const tcu::RGBA& colorA, const tcu::RGBA& colorB, const tcu::IVec3& compareThreshold)
3485 static bool pixelNeighborhoodContainsColor (const tcu::Surface& target, int x, int y, const tcu::RGBA& color, const tcu::IVec3& compareThreshold)
3494 const tcu::RGBA targetCmpPixel = target.getPixel(x+dx, y+dy);
3503 static bool pixelNeighborhoodContainsCoverage (const tcu::Surface& target, int x, int y, bool coverage)
3512 const bool targetCmpCoverage = !isBlack(target.getPixel(x+dx, y+dy));
3520 static bool edgeRelaxedImageCompare (tcu::TestLog& log, const char* imageSetName, const char* imageSetDesc, const tcu::Surface& reference, const tcu::Surface& result, const tcu::IVec3& compareThreshold, const tcu::IVec3& renderTargetThreshold, int maxAllowedInvalidPixels)
3524 const tcu::IVec4 green (0, 255, 0, 255);
3525 const tcu::IVec4 red (255, 0, 0, 255);
3526 const int width = reference.getWidth();
3527 const int height = reference.getHeight();
3529 const tcu::PixelBufferAccess errorAccess = errorMask.getAccess();
3544 const tcu::RGBA refPixel = reference.getPixel(x, y);
3545 const tcu::RGBA screenPixel = result.getPixel(x, y);
3546 const bool directMatch = colorsEqual(refPixel, screenPixel, compareThreshold);
3547 const bool isOkReferencePixel = directMatch || pixelNeighborhoodContainsColor(result, x, y, refPixel, compareThreshold); // screen image has a matching pixel nearby (~= If something is drawn on reference, it must be drawn to screen too.)
3548 const bool isOkScreenPixel = directMatch || pixelNeighborhoodContainsColor(reference, x, y, screenPixel, compareThreshold); // reference image has a matching pixel nearby (~= If something is drawn on screen, it must be drawn to reference too.)
3553 const deUint32 grayscaleValue = getVisualizationGrayscaleColor(screenPixel);
3565 const bool referenceCoverage = !isBlack(refPixel);
3566 const bool screenCoverage = !isBlack(screenPixel);
3567 const bool isOkReferenceCoverage = pixelNeighborhoodContainsCoverage(result, x, y, referenceCoverage); // Check reference pixel against screen pixel
3568 const bool isOkScreenCoverage = pixelNeighborhoodContainsCoverage(reference, x, y, screenCoverage); // Check screen pixels against reference pixel
3573 const deUint32 grayscaleValue = getVisualizationGrayscaleColor(screenPixel);
3615 static bool intersectionRelaxedLineImageCompare (tcu::TestLog& log, const char* imageSetName, const char* imageSetDesc, const tcu::Surface& reference, const tcu::Surface& result, const tcu::IVec3& compareThreshold, int maxAllowedInvalidPixels)
3619 const tcu::IVec4 green (0, 255, 0, 255);
3620 const tcu::IVec4 red (255, 0, 0, 255);
3621 const int width = reference.getWidth();
3622 const int height = reference.getHeight();
3624 const tcu::PixelBufferAccess errorAccess = errorMask.getAccess();
3639 const tcu::RGBA refPixel = reference.getPixel(x, y);
3640 const tcu::RGBA screenPixel = result.getPixel(x, y);
3641 const bool directMatch = colorsEqual(refPixel, screenPixel, compareThreshold);
3642 const bool isOkScreenPixel = directMatch || pixelNeighborhoodContainsColor(reference, x, y, screenPixel, compareThreshold); // reference image has a matching pixel nearby (~= If something is drawn on screen, it must be drawn to reference too.)
3643 const bool isOkReferencePixel = directMatch || pixelNeighborhoodContainsColor(result, x, y, refPixel, compareThreshold); // screen image has a matching pixel nearby (~= If something is drawn on reference, it must be drawn to screen too.)
3648 const deUint32 grayscaleValue = getVisualizationGrayscaleColor(screenPixel);
3662 const bool referenceCoverage = !isBlack(refPixel);
3663 const bool screenCoverage = !isBlack(screenPixel);
3664 const bool isOkScreenCoverage = pixelNeighborhoodContainsCoverage(reference, x, y, screenCoverage); // Check screen pixels against reference pixel
3665 const bool isOkReferenceCoverage = pixelNeighborhoodContainsCoverage(result, x, y, referenceCoverage); // Check reference pixel against screen pixel
3670 const deUint32 grayscaleValue = getVisualizationGrayscaleColor(screenPixel);
3714 const tcu::Surface& ref = m_rrArrayPack->getSurface();
3715 const tcu::Surface& screen = m_glArrayPack->getSurface();
3725 const PrimitiveClass primitiveClass = getDrawPrimitiveClass(primitiveType);
3726 const int maxAllowedInvalidPixelsWithPoints = 0; //!< points are unlikely to have overlapping fragments
3727 const int maxAllowedInvalidPixelsWithLines = 5; //!< line are allowed to have a few bad pixels
3728 const int maxAllowedInvalidPixelsWithTriangles = 10;
3768 const tcu::IVec3 renderTargetThreshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold().toIVec().xyz();
3787 float DrawTest::getCoordScale (const DrawTestSpec& spec) const
3794 const bool isPositionAttr = (arrayNdx == 0) || (attribSpec.additionalPositionAttribute);
3816 const float max = GLValue::getMaxValue(attribSpec.inputType).toFloat();
3832 float DrawTest::getColorScale (const DrawTestSpec& spec) const
3839 const bool isPositionAttr = (arrayNdx == 0) || (attribSpec.additionalPositionAttribute);
3856 const float max = GLValue::getMaxValue(attribSpec.inputType).toFloat();