• Home
  • Raw
  • Download

Lines Matching refs:tcu

67 using tcu::TestLog;
186 static inline tcu::BVec4 getDerivateMask (glu::DataType type) in getDerivateMask()
190 case glu::TYPE_FLOAT: return tcu::BVec4(true, false, false, false); in getDerivateMask()
191 case glu::TYPE_FLOAT_VEC2: return tcu::BVec4(true, true, false, false); in getDerivateMask()
192 case glu::TYPE_FLOAT_VEC3: return tcu::BVec4(true, true, true, false); in getDerivateMask()
193 case glu::TYPE_FLOAT_VEC4: return tcu::BVec4(true, true, true, true); in getDerivateMask()
196 return tcu::BVec4(true); in getDerivateMask()
200 static inline tcu::Vec4 readDerivate (const tcu::ConstPixelBufferAccess& surface, const tcu::Vec4& … in readDerivate()
205 static inline tcu::UVec4 getCompExpBits (const tcu::Vec4& v) in getCompExpBits()
207 return tcu::UVec4(tcu::Float32(v[0]).exponentBits(), in getCompExpBits()
208 tcu::Float32(v[1]).exponentBits(), in getCompExpBits()
209 tcu::Float32(v[2]).exponentBits(), in getCompExpBits()
210 tcu::Float32(v[3]).exponentBits()); in getCompExpBits()
217 const int exp = tcu::Float32(value).exponent(); in computeFloatingPointError()
219 …return tcu::Float32::construct(+1, exp, (1u<<23) | mask).asFloat() - tcu::Float32::construct(+1, e… in computeFloatingPointError()
255 …return tcu::Float32::construct(+1, exp, (1<<23) | (1 << ulpBitNdx)).asFloat() - tcu::Float32::cons… in getSingleULPForExponent()
260 return tcu::Float32::construct(+1, exp, (1<<23)).asFloat(); in getSingleULPForExponent()
266 const int exp = tcu::Float32(value).exponent(); in getSingleULPForValue()
278 const tcu::Float32 inputFloat = tcu::Float32(value); in convertFloatFlushToZeroRtn()
284 if (value > 0.0f && tcu::Float32(value).exponent() < minExponent) in convertFloatFlushToZeroRtn()
292 …return tcu::Float32::construct(+1, inputFloat.exponent(), inputFloat.mantissa() & ~truncMask).asFl… in convertFloatFlushToZeroRtn()
300 …return tcu::Float32::construct(-1, inputFloat.exponent(), inputFloat.mantissa() & ~truncMask).asFl… in convertFloatFlushToZeroRtn()
326 …tatic inline tcu::Vec4 getDerivateThreshold (const glu::Precision precision, const tcu::Vec4& valu… in getDerivateThreshold()
329 const tcu::UVec4 derivExp = getCompExpBits(expectedDerivate); in getDerivateThreshold()
330 const tcu::UVec4 maxValueExp = max(getCompExpBits(valueMin), getCompExpBits(valueMax)); in getDerivateThreshold()
331 const tcu::UVec4 numBitsLost = maxValueExp - min(maxValueExp, derivExp); in getDerivateThreshold()
332 …const tcu::IVec4 numAccurateBits = max(baseBits - numBitsLost.asInt() - (int)INTERPOLATION_LOST_BI… in getDerivateThreshold()
334 return tcu::Vec4(computeFloatingPointError(expectedDerivate[0], numAccurateBits[0]), in getDerivateThreshold()
345 const tcu::Vec4& v;
348 LogVecComps (const tcu::Vec4& v_, int numComps_) in LogVecComps()
372 static bool verifyConstantDerivate (tcu::TestLog& log, in verifyConstantDerivate()
373 const tcu::ConstPixelBufferAccess& result, in verifyConstantDerivate()
374 const tcu::PixelBufferAccess& errorMask, in verifyConstantDerivate()
376 const tcu::Vec4& reference, in verifyConstantDerivate()
377 const tcu::Vec4& threshold, in verifyConstantDerivate()
378 const tcu::Vec4& scale, in verifyConstantDerivate()
379 const tcu::Vec4& bias, in verifyConstantDerivate()
383 const tcu::BVec4 mask = tcu::logicalNot(getDerivateMask(dataType)); in verifyConstantDerivate()
393 const tcu::Vec4 resDerivate = readDerivate(result, scale, bias, x, y); in verifyConstantDerivate()
394 …const bool isOk = tcu::allEqual(tcu::logicalOr(tcu::lessThanEqual(tcu::abs(reference - resDeri… in verifyConstantDerivate()
400 << ", diff = " << LogVecComps(tcu::abs(reference - resDerivate), numComps) in verifyConstantDerivate()
404 errorMask.setPixel(tcu::RGBA::red.toVec(), x, y); in verifyConstantDerivate()
420 tcu::Matrix<float, 4, 3> matrix;
427 tcu::Vec4 evaluateAt (float screenX, float screenY) const;
430 tcu::Vec4 Linear2DFunctionEvaluator::evaluateAt (float screenX, float screenY) const in evaluateAt()
432 const tcu::Vec3 position(screenX, screenY, 1.0f); in evaluateAt()
436 static bool reverifyConstantDerivateWithFlushRelaxations (tcu::TestLog& log, in reverifyConstantDerivateWithFlushRelaxations()
437 const tcu::ConstPixelBufferAccess& result, in reverifyConstantDerivateWithFlushRelaxations()
438 const tcu::PixelBufferAccess& errorMask, in reverifyConstantDerivateWithFlushRelaxations()
441 const tcu::Vec4& derivScale, in reverifyConstantDerivateWithFlushRelaxations()
442 const tcu::Vec4& derivBias, in reverifyConstantDerivateWithFlushRelaxations()
443 const tcu::Vec4& surfaceThreshold, in reverifyConstantDerivateWithFlushRelaxations()
451 const tcu::IVec4 red (255, 0, 0, 255); in reverifyConstantDerivateWithFlushRelaxations()
452 const tcu::IVec4 green (0, 255, 0, 255); in reverifyConstantDerivateWithFlushRelaxations()
462 tcu::clear(errorMask, green); in reverifyConstantDerivateWithFlushRelaxations()
472 const tcu::Vec4 resultDerivative = readDerivate(result, derivScale, derivBias, x, y); in reverifyConstantDerivateWithFlushRelaxations()
480 const tcu::Vec4 functionValueForward = (derivateFunc == DERIVATE_DFDX) in reverifyConstantDerivateWithFlushRelaxations()
483 const tcu::Vec4 functionValueBackward = (derivateFunc == DERIVATE_DFDX) in reverifyConstantDerivateWithFlushRelaxations()
493 …const tcu::Interval forwardComponent (convertFloatFlushToZeroRtn(addErrorUlp((float)functionValue… in reverifyConstantDerivateWithFlushRelaxations()
495 …const tcu::Interval backwardComponent (convertFloatFlushToZeroRtn(addErrorUlp((float)functionValu… in reverifyConstantDerivateWithFlushRelaxations()
497 …const int maxValueExp = de::max(de::max(tcu::Float32(forwardComponent.lo()).exponent(), tcu in reverifyConstantDerivateWithFlushRelaxations()
498 …de::max(tcu::Float32(backwardComponent.lo()).exponent(), tcu::Float32(backwardComponent.hi()).exp… in reverifyConstantDerivateWithFlushRelaxations()
503 const tcu::Interval numerator (forwardComponent - backwardComponent); in reverifyConstantDerivateWithFlushRelaxations()
504 const int numeratorLoExp = tcu::Float32(numerator.lo()).exponent(); in reverifyConstantDerivateWithFlushRelaxations()
505 const int numeratorHiExp = tcu::Float32(numerator.hi()).exponent(); in reverifyConstantDerivateWithFlushRelaxations()
511 …const tcu::Interval numeratorRange (convertFloatFlushToZeroRtn((float)numerator.lo(), minExponen… in reverifyConstantDerivateWithFlushRelaxations()
514 …const tcu::Interval divisionRange = numeratorRange / 3.0f; // legal sample area is anywhere with… in reverifyConstantDerivateWithFlushRelaxations()
515 …const tcu::Interval divisionResultRange (convertFloatFlushToZeroRtn(addErrorUlp((float)divisionRa… in reverifyConstantDerivateWithFlushRelaxations()
517 …const tcu::Interval finalResultRange (divisionResultRange.lo() - surfaceThreshold[c], divisionRes… in reverifyConstantDerivateWithFlushRelaxations()
526 log << tcu::TestLog::Message in reverifyConstantDerivateWithFlushRelaxations()
537 << tcu::TestLog::EndMessage; in reverifyConstantDerivateWithFlushRelaxations()
569 …virtual bool verify (const tcu::ConstPixelBufferAccess& result, const tcu::PixelBufferAccess&…
571 tcu::IVec2 getViewportSize (void) const;
572 tcu::Vec4 getSurfaceThreshold (void) const;
582 tcu::Vec4 m_coordMin;
583 tcu::Vec4 m_coordMax;
584 tcu::Vec4 m_derivScale;
585 tcu::Vec4 m_derivBias;
630 return tcu::StringTemplate(vertexTmpl).specialize(vertexParams); in genVertexSource()
633 inline tcu::IVec2 TriangleDerivateCase::getViewportSize (void) const in getViewportSize()
639 return tcu::IVec2(width, height); in getViewportSize()
642 return tcu::IVec2(FBO_WIDTH, FBO_HEIGHT); in getViewportSize()
652 const tcu::IVec2 viewportSize = getViewportSize(); in iterate()
657 tcu::TextureLevel result; in iterate()
682 const tcu::PixelFormat pixelFormat = m_context.getRenderTarget().getPixelFormat(); in iterate()
801 …result.setStorage(tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), vi… in iterate()
807 const tcu::TextureFormat dataFormat (tcu::TextureFormat::RGBA, tcu::TextureFormat::FLOAT); in iterate()
808 …const tcu::TextureFormat transferFormat (tcu::TextureFormat::RGBA, tcu::TextureFormat::UNSIGNED_IN… in iterate()
812tcu::PixelBufferAccess(transferFormat, result.getWidth(), result.getHeight(), result.getDepth(), r… in iterate()
825 tcu::Surface errorMask(result.getWidth(), result.getHeight()); in iterate()
826 tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toVec()); in iterate()
845 tcu::Vec4 TriangleDerivateCase::getSurfaceThreshold (void) const in getSurfaceThreshold()
851 const tcu::PixelFormat pixelFormat = m_context.getRenderTarget().getPixelFormat(); in getSurfaceThreshold()
852 …const tcu::IVec4 channelBits (pixelFormat.redBits, pixelFormat.greenBits, pixelFormat.blueBits, … in getSurfaceThreshold()
853 const tcu::IVec4 intThreshold = tcu::IVec4(1) << (8 - channelBits); in getSurfaceThreshold()
854 const tcu::Vec4 normThreshold = intThreshold.asFloat() / 255.0f; in getSurfaceThreshold()
859 case SURFACETYPE_UNORM_FBO: return tcu::IVec4(1).asFloat() / 255.0f; in getSurfaceThreshold()
860 case SURFACETYPE_FLOAT_FBO: return tcu::Vec4(0.0f); in getSurfaceThreshold()
863 return tcu::Vec4(0.0f); in getSurfaceThreshold()
878 …bool verify (const tcu::ConstPixelBufferAccess& result, const tcu::PixelBufferAccess& erro…
919 m_fragmentSrc = tcu::StringTemplate(fragmentTmpl).specialize(fragmentParams); in init()
921 m_derivScale = tcu::Vec4(1e3f, 1e3f, 1e3f, 1e3f); in init()
922 m_derivBias = tcu::Vec4(0.5f, 0.5f, 0.5f, 0.5f); in init()
925 bool ConstantDerivateCase::verify (const tcu::ConstPixelBufferAccess& result, const tcu::PixelBuffe… in verify()
927 const tcu::Vec4 reference (0.0f); // Derivate of constant argument should always be 0 in verify()
928 const tcu::Vec4 threshold = getSurfaceThreshold() / abs(m_derivScale); in verify()
945 …bool verify (const tcu::ConstPixelBufferAccess& result, const tcu::PixelBufferAccess& error…
968 const tcu::IVec2 viewportSize = getViewportSize(); in init()
995 m_fragmentSrc = tcu::StringTemplate(m_fragmentTmpl.c_str()).specialize(fragmentParams); in init()
1000 m_coordMin = tcu::Vec4(-97.f, 0.2f, 71.f, 74.f); in init()
1001 m_coordMax = tcu::Vec4(-13.2f, -77.f, 44.f, 76.f); in init()
1005 m_coordMin = tcu::Vec4(-37.0f, 47.f, -7.f, 0.0f); in init()
1006 m_coordMax = tcu::Vec4(-1.0f, 12.f, 7.f, 19.f); in init()
1010 m_coordMin = tcu::Vec4(0.0f, -1.0f, 0.0f, 1.0f); in init()
1011 m_coordMax = tcu::Vec4(1.0f, 1.0f, -1.0f, -1.0f); in init()
1021 m_derivScale = tcu::Vec4(1.0f); in init()
1022 m_derivBias = tcu::Vec4(0.0f); in init()
1027 const tcu::Vec4 dx = (m_coordMax - m_coordMin) / tcu::Vec4(w, w, w*0.5f, -w*0.5f); in init()
1028 const tcu::Vec4 dy = (m_coordMax - m_coordMin) / tcu::Vec4(h, h, h*0.5f, -h*0.5f); in init()
1041 m_derivScale = 0.5f / (tcu::abs(dx) + tcu::abs(dy)); in init()
1048 m_derivBias = tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f); in init()
1052 bool LinearDerivateCase::verify (const tcu::ConstPixelBufferAccess& result, const tcu::PixelBufferA… in verify()
1054 const tcu::Vec4 xScale = tcu::Vec4(1.0f, 0.0f, 0.5f, -0.5f); in verify()
1055 const tcu::Vec4 yScale = tcu::Vec4(0.0f, 1.0f, 0.5f, -0.5f); in verify()
1056 const tcu::Vec4 surfaceThreshold = getSurfaceThreshold() / abs(m_derivScale); in verify()
1062 const tcu::Vec4 scale = isX ? xScale : yScale; in verify()
1063 const tcu::Vec4 reference = ((m_coordMax - m_coordMin) / div) * scale; in verify()
1064 …const tcu::Vec4 opThreshold = getDerivateThreshold(m_precision, m_coordMin*scale, m_coordMax*scal… in verify()
1065 const tcu::Vec4 threshold = max(surfaceThreshold, opThreshold); in verify()
1069 << tcu::TestLog::Message in verify()
1072 << tcu::TestLog::EndMessage; in verify()
1081 << tcu::TestLog::Message in verify()
1083 << tcu::TestLog::EndMessage; in verify()
1092 << tcu::TestLog::Message in verify()
1095 << tcu::TestLog::EndMessage; in verify()
1098 const tcu::IVec2 viewportSize = getViewportSize(); in verify()
1101 const tcu::Vec4 valueRamp = (m_coordMax - m_coordMin); in verify()
1104 function.matrix.setRow(0, tcu::Vec3(valueRamp.x() / w, 0.0f, m_coordMin.x())); in verify()
1105 function.matrix.setRow(1, tcu::Vec3(0.0f, valueRamp.y() / h, m_coordMin.y())); in verify()
1106 …function.matrix.setRow(2, tcu::Vec3(valueRamp.z() / w, valueRamp.z() / h, m_coordMin.z() + m_coord… in verify()
1107 …function.matrix.setRow(3, tcu::Vec3(-valueRamp.w() / w, -valueRamp.w() / h, m_coordMax.w() + m_coo… in verify()
1121 const tcu::Vec4 dx = ((m_coordMax - m_coordMin) / w) * xScale; in verify()
1122 const tcu::Vec4 dy = ((m_coordMax - m_coordMin) / h) * yScale; in verify()
1123 const tcu::Vec4 reference = tcu::abs(dx) + tcu::abs(dy); in verify()
1124 …const tcu::Vec4 dxThreshold = getDerivateThreshold(m_precision, m_coordMin*xScale, m_coordMax*xSc… in verify()
1125 …const tcu::Vec4 dyThreshold = getDerivateThreshold(m_precision, m_coordMin*yScale, m_coordMax*ySc… in verify()
1126 const tcu::Vec4 threshold = max(surfaceThreshold, max(dxThreshold, dyThreshold)); in verify()
1146 …bool verify (const tcu::ConstPixelBufferAccess& result, const tcu::PixelBufferAccess& error…
1151 tcu::Vec4 m_texValueMin;
1152 tcu::Vec4 m_texValueMax;
1221 m_fragmentSrc = tcu::StringTemplate(fragmentTmpl).specialize(fragmentParams); in init()
1232 m_texValueMin = tcu::Vec4(-97.f, 0.2f, 71.f, 74.f); in init()
1233 m_texValueMax = tcu::Vec4(-13.2f, -77.f, 44.f, 76.f); in init()
1237 m_texValueMin = tcu::Vec4(-37.0f, 47.f, -7.f, 0.0f); in init()
1238 m_texValueMax = tcu::Vec4(-1.0f, 12.f, 7.f, 19.f); in init()
1242 m_texValueMin = tcu::Vec4(0.0f, -1.0f, 0.0f, 1.0f); in init()
1243 m_texValueMax = tcu::Vec4(1.0f, 1.0f, -1.0f, -1.0f); in init()
1252 const tcu::IVec2 viewportSize = getViewportSize(); in init()
1259 m_coordMin = tcu::Vec4(0.0f); in init()
1260 m_coordMax = tcu::Vec4(1.0f); in init()
1264 const tcu::PixelBufferAccess level0 = m_texture->getRefTexture().getLevel(0); in init()
1271 const tcu::Vec4 s = tcu::Vec4(xf, yf, (xf+yf)/2.0f, 1.0f - (xf+yf)/2.0f); in init()
1283 m_derivScale = tcu::Vec4(1.0f); in init()
1284 m_derivBias = tcu::Vec4(0.0f); in init()
1289 const tcu::IVec2 viewportSize = getViewportSize(); in init()
1292 const tcu::Vec4 dx = (m_texValueMax - m_texValueMin) / tcu::Vec4(w, w, w*0.5f, -w*0.5f); in init()
1293 const tcu::Vec4 dy = (m_texValueMax - m_texValueMin) / tcu::Vec4(h, h, h*0.5f, -h*0.5f); in init()
1306 m_derivScale = 0.5f / (tcu::abs(dx) + tcu::abs(dy)); in init()
1313 m_derivBias = tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f); in init()
1338 bool TextureDerivateCase::verify (const tcu::ConstPixelBufferAccess& result, const tcu::PixelBuffer… in verify()
1342 throw tcu::NotSupportedError("Too small viewport"); in verify()
1344tcu::ConstPixelBufferAccess compareArea = tcu::getSubregion(result, 1, 1, result.getWidth()-2, r… in verify()
1345tcu::PixelBufferAccess maskArea = tcu::getSubregion(errorMask, 1, 1, errorMask.getWidth()-2, er… in verify()
1346 const tcu::Vec4 xScale = tcu::Vec4(1.0f, 0.0f, 0.5f, -0.5f); in verify()
1347 const tcu::Vec4 yScale = tcu::Vec4(0.0f, 1.0f, 0.5f, -0.5f); in verify()
1351 const tcu::Vec4 surfaceThreshold = getSurfaceThreshold() / abs(m_derivScale); in verify()
1357 const tcu::Vec4 scale = isX ? xScale : yScale; in verify()
1358 const tcu::Vec4 reference = ((m_texValueMax - m_texValueMin) / div) * scale; in verify()
1359 …const tcu::Vec4 opThreshold = getDerivateThreshold(m_precision, m_texValueMin*scale, m_texValueMa… in verify()
1360 const tcu::Vec4 threshold = max(surfaceThreshold, opThreshold); in verify()
1364 << tcu::TestLog::Message in verify()
1367 << tcu::TestLog::EndMessage; in verify()
1376 << tcu::TestLog::Message in verify()
1378 << tcu::TestLog::EndMessage; in verify()
1387 << tcu::TestLog::Message in verify()
1390 << tcu::TestLog::EndMessage; in verify()
1393 const tcu::Vec4 valueRamp = (m_texValueMax - m_texValueMin); in verify()
1396 function.matrix.setRow(0, tcu::Vec3(valueRamp.x() / w, 0.0f, m_texValueMin.x())); in verify()
1397 function.matrix.setRow(1, tcu::Vec3(0.0f, valueRamp.y() / h, m_texValueMin.y())); in verify()
1398 …function.matrix.setRow(2, tcu::Vec3(valueRamp.z() / w, valueRamp.z() / h, m_texValueMin.z() + m_te… in verify()
1399 …function.matrix.setRow(3, tcu::Vec3(-valueRamp.w() / w, -valueRamp.w() / h, m_texValueMax.w() + m_… in verify()
1410 const tcu::Vec4 dx = ((m_texValueMax - m_texValueMin) / w) * xScale; in verify()
1411 const tcu::Vec4 dy = ((m_texValueMax - m_texValueMin) / h) * yScale; in verify()
1412 const tcu::Vec4 reference = tcu::abs(dx) + tcu::abs(dy); in verify()
1413 …const tcu::Vec4 dxThreshold = getDerivateThreshold(m_precision, m_texValueMin*xScale, m_texValueMa… in verify()
1414 …const tcu::Vec4 dyThreshold = getDerivateThreshold(m_precision, m_texValueMin*yScale, m_texValueMa… in verify()
1415 const tcu::Vec4 threshold = max(surfaceThreshold, max(dxThreshold, dyThreshold)); in verify()
1664tcu::TestCaseGroup* const functionGroup = new tcu::TestCaseGroup(m_testCtx, getDerivateFuncCaseNam… in init()
1669tcu::TestCaseGroup* const constantGroup = new tcu::TestCaseGroup(m_testCtx, "constant", "Derivate … in init()
1682tcu::TestCaseGroup* const linearCaseGroup = new tcu::TestCaseGroup(m_testCtx, s_linearDerivateCase… in init()
1710tcu::TestCaseGroup* const fboGroup = new tcu::TestCaseGroup(m_testCtx, s_fboConfigs[caseNdx].name… in init()
1738tcu::TestCaseGroup* const hintGroup = new tcu::TestCaseGroup(m_testCtx, s_hints[hintCaseNdx].name… in init()
1745tcu::TestCaseGroup* const fboGroup = new tcu::TestCaseGroup(m_testCtx, s_hintFboConfigs[fboCaseNd… in init()
1771tcu::TestCaseGroup* const textureGroup = new tcu::TestCaseGroup(m_testCtx, "texture", "Derivate of… in init()
1776tcu::TestCaseGroup* const caseGroup = new tcu::TestCaseGroup(m_testCtx, s_textureConfigs[texCaseN… in init()