Lines Matching refs:Precision
123 inline bool supportsSignedZero (glu::Precision precision)
127 return precision == glu::PRECISION_HIGHP;
149 static int getMinMantissaBits (glu::Precision precision)
158 DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(bits)));
159 return bits[precision];
390 static const char* getPrecisionPostfix (glu::Precision precision)
399 DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
400 return s_postfix[precision];
414 static std::string getCommonFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
416 return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
422 AbsCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
423 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "abs", shaderType)
425 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
426 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
447 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
451 fillRandomScalars(rnd, floatRanges[precision].x(), floatRanges[precision].y(), values[0], numValues*scalarSize);
453 fillRandomScalars(rnd, intRanges[precision].x(), intRanges[precision].y(), values[0], numValues*scalarSize);
459 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
464 const int mantissaBits = getMinMantissaBits(precision);
504 SignCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
505 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "sign", shaderType)
507 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
508 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
529 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
538 fillRandomScalars(rnd, floatRanges[precision].x(), floatRanges[precision].y(), (float*)values[0] + scalarSize*3, (numValues-3)*scalarSize);
545 fillRandomScalars(rnd, intRanges[precision].x(), intRanges[precision].y(), (int*)values[0] + scalarSize*3, (numValues-3)*scalarSize);
552 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
558 const deUint32 maxUlpDiff = precision == glu::PRECISION_LOWP ? getMaxUlpDiffFromBits(getMinMantissaBits(precision)) : 0;
610 RoundEvenCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
611 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "roundEven", shaderType)
613 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
614 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
629 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
634 if (precision != glu::PRECISION_LOWP)
639 const float v = de::clamp(float(ndx) - 10.5f, ranges[precision].x(), ranges[precision].y());
646 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + numSpecialCases*scalarSize, (numValues-numSpecialCases)*scalarSize);
648 // If precision is mediump, make sure values can be represented in fp16 exactly
649 if (precision == glu::PRECISION_MEDIUMP)
659 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
660 const bool hasSignedZero = supportsSignedZero(precision);
663 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
683 const int mantissaBits = getMinMantissaBits(precision);
721 ModfCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
722 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "modf", shaderType)
724 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
725 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
726 m_spec.outputs.push_back(Symbol("out1", glu::VarType(baseType, precision)));
741 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
744 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), values[0], numValues*scalarSize);
750 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
751 const bool hasZeroSign = supportsSignedZero(precision);
754 const int mantissaBits = getMinMantissaBits(precision);
765 const int bitsLost = precision != glu::PRECISION_HIGHP ? numBitsLostInOp(in0, refOut0) : 0;
787 IsnanCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
788 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "isnan", shaderType)
795 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
804 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
806 const int mantissaBits = getMinMantissaBits(precision);
827 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
830 if (precision == glu::PRECISION_HIGHP)
868 IsinfCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
869 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "isinf", shaderType)
876 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
885 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
887 const int mantissaBits = getMinMantissaBits(precision);
908 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
911 if (precision == glu::PRECISION_HIGHP)
949 FloatBitsToUintIntCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType, bool outIsSigned)
950 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), outIsSigned ? "floatBitsToInt" : "floatBitsToUint", shaderType)
956 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
972 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
975 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), values[0], numValues*scalarSize);
981 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
984 const int mantissaBits = getMinMantissaBits(precision);
1009 FloatBitsToIntCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1010 : FloatBitsToUintIntCase(context, baseType, precision, shaderType, true)
1018 FloatBitsToUintCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1019 : FloatBitsToUintIntCase(context, baseType, precision, shaderType, false)
1077 FloorCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1078 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "floor", shaderType)
1080 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1081 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1096 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1099 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0], numValues*scalarSize);
1101 // If precision is mediump, make sure values can be represented in fp16 exactly
1102 if (precision == glu::PRECISION_MEDIUMP)
1112 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1115 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1135 const int mantissaBits = getMinMantissaBits(precision);
1173 TruncCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1174 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "trunc", shaderType)
1176 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1177 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1192 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1205 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + scalarSize*numSpecialCases, (numValues-numSpecialCases)*scalarSize);
1207 // If precision is mediump, make sure values can be represented in fp16 exactly
1208 if (precision == glu::PRECISION_MEDIUMP)
1218 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1221 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1243 const int mantissaBits = getMinMantissaBits(precision);
1281 RoundCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1282 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "round", shaderType)
1284 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1285 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1300 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1305 if (precision != glu::PRECISION_LOWP)
1310 const float v = de::clamp(float(ndx) - 5.5f, ranges[precision].x(), ranges[precision].y());
1317 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + numSpecialCases*scalarSize, (numValues-numSpecialCases)*scalarSize);
1319 // If precision is mediump, make sure values can be represented in fp16 exactly
1320 if (precision == glu::PRECISION_MEDIUMP)
1330 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1331 const bool hasZeroSign = supportsSignedZero(precision);
1334 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1371 const int mantissaBits = getMinMantissaBits(precision);
1409 CeilCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1410 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "ceil", shaderType)
1412 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1413 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1428 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1432 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0], numValues*scalarSize);
1434 // If precision is mediump, make sure values can be represented in fp16 exactly
1435 if (precision == glu::PRECISION_MEDIUMP)
1445 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1446 const bool hasZeroSign = supportsSignedZero(precision);
1449 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1469 const int mantissaBits = getMinMantissaBits(precision);
1514 FractCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1515 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "fract", shaderType)
1517 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1518 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1533 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1538 if (precision != glu::PRECISION_LOWP)
1543 const float v = de::clamp(float(ndx) - 5.5f, ranges[precision].x(), ranges[precision].y());
1550 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + numSpecialCases*scalarSize, (numValues-numSpecialCases)*scalarSize);
1552 // If precision is mediump, make sure values can be represented in fp16 exactly
1553 if (precision == glu::PRECISION_MEDIUMP)
1563 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1564 const bool hasZeroSign = supportsSignedZero(precision);
1567 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1587 const int mantissaBits = getMinMantissaBits(precision);
1659 group->addChild(new TestClass(parent->getContext(), glu::DataType(scalarType + vecSize - 1), glu::Precision(prec), glu::ShaderType(shaderType)));