Lines Matching refs:glu

124 inline bool supportsSignedZero (glu::Precision precision)
128 return precision == glu::PRECISION_HIGHP;
150 static int getMinMantissaBits (glu::Precision precision)
158 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(bits) == glu::PRECISION_LAST);
163 static int getMaxNormalizedValueExponent (glu::Precision precision)
171 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(exponent) == glu::PRECISION_LAST);
176 static int getMinNormalizedValueExponent (glu::Precision precision)
184 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(exponent) == glu::PRECISION_LAST);
194 CommonFunctionCase (Context& context, const char* name, const char* description, glu::ShaderType shaderType);
208 glu::ShaderType m_shaderType;
218 CommonFunctionCase::CommonFunctionCase (Context& context, const char* name, const char* description, glu::ShaderType shaderType)
224 m_spec.version = glu::GLSL_VERSION_310_ES;
285 // \todo [2013-08-08 pyry] Make generic utility and move to glu?
311 const glu::VarType& type;
314 VarValue (const glu::VarType& type_, const void* value_) : type(type_), value(value_) {}
321 const glu::DataType basicType = varValue.type.getBasicType();
322 const glu::DataType scalarType = glu::getDataTypeScalarType(basicType);
323 const int numComponents = glu::getDataTypeScalarSize(basicType);
326 str << glu::getDataTypeName(basicType) << "(";
335 case glu::TYPE_FLOAT: str << HexFloat(((const float*)varValue.value)[compNdx]); break;
336 case glu::TYPE_INT: str << ((const deInt32*)varValue.value)[compNdx]; break;
337 case glu::TYPE_UINT: str << tcu::toHex(((const deUint32*)varValue.value)[compNdx]); break;
338 case glu::TYPE_BOOL: str << HexBool(((const deUint32*)varValue.value)[compNdx]); break;
417 static const char* getPrecisionPostfix (glu::Precision precision)
425 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
430 static const char* getShaderTypePostfix (glu::ShaderType shaderType)
445 static std::string getCommonFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
447 return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
453 AbsCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
456 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
457 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
477 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
478 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
479 const int scalarSize = glu::getDataTypeScalarSize(type);
481 if (glu::isDataTypeFloatOrVec(type))
489 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
490 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
491 const int scalarSize = glu::getDataTypeScalarSize(type);
493 if (glu::isDataTypeFloatOrVec(type))
535 SignCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
538 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
539 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
559 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
560 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
561 const int scalarSize = glu::getDataTypeScalarSize(type);
563 if (glu::isDataTypeFloatOrVec(type))
582 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
583 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
584 const int scalarSize = glu::getDataTypeScalarSize(type);
586 if (glu::isDataTypeFloatOrVec(type))
589 const deUint32 maxUlpDiff = precision == glu::PRECISION_LOWP ? getMaxUlpDiffFromBits(getMinMantissaBits(precision)) : 0;
641 RoundEvenCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
644 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
645 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
659 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
660 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
661 const int scalarSize = glu::getDataTypeScalarSize(type);
665 if (precision != glu::PRECISION_LOWP)
680 if (precision == glu::PRECISION_MEDIUMP)
689 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
690 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
692 const int scalarSize = glu::getDataTypeScalarSize(type);
694 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
752 ModfCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
755 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
756 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
757 m_spec.outputs.push_back(Symbol("out1", glu::VarType(baseType, precision)));
771 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
772 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
773 const int scalarSize = glu::getDataTypeScalarSize(type);
780 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
781 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
783 const int scalarSize = glu::getDataTypeScalarSize(type);
796 const int bitsLost = precision != glu::PRECISION_HIGHP ? numBitsLostInOp(in0, refOut0) : 0;
818 IsnanCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
821 DE_ASSERT(glu::isDataTypeFloatOrVec(baseType));
823 const int vecSize = glu::getDataTypeScalarSize(baseType);
824 const glu::DataType boolType = vecSize > 1 ? glu::getDataTypeBoolVec(vecSize) : glu::TYPE_BOOL;
826 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
827 m_spec.outputs.push_back(Symbol("out0", glu::VarType(boolType, glu::PRECISION_LAST)));
834 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
835 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
836 const int scalarSize = glu::getDataTypeScalarSize(type);
857 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
858 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
859 const int scalarSize = glu::getDataTypeScalarSize(type);
861 if (precision == glu::PRECISION_HIGHP)
877 else if (precision == glu::PRECISION_MEDIUMP || precision == glu::PRECISION_LOWP)
901 IsinfCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
904 DE_ASSERT(glu::isDataTypeFloatOrVec(baseType));
906 const int vecSize = glu::getDataTypeScalarSize(baseType);
907 const glu::DataType boolType = vecSize > 1 ? glu::getDataTypeBoolVec(vecSize) : glu::TYPE_BOOL;
909 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
910 m_spec.outputs.push_back(Symbol("out0", glu::VarType(boolType, glu::PRECISION_LAST)));
917 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
918 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
919 const int scalarSize = glu::getDataTypeScalarSize(type);
940 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
941 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
942 const int scalarSize = glu::getDataTypeScalarSize(type);
944 if (precision == glu::PRECISION_HIGHP)
960 else if (precision == glu::PRECISION_MEDIUMP)
985 FloatBitsToUintIntCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType, bool outIsSigned)
988 const int vecSize = glu::getDataTypeScalarSize(baseType);
989 const glu::DataType intType = outIsSigned ? (vecSize > 1 ? glu::getDataTypeIntVec(vecSize) : glu::TYPE_INT)
990 : (vecSize > 1 ? glu::getDataTypeUintVec(vecSize) : glu::TYPE_UINT);
992 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
993 m_spec.outputs.push_back(Symbol("out0", glu::VarType(intType, glu::PRECISION_HIGHP)));
1007 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1008 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1009 const int scalarSize = glu::getDataTypeScalarSize(type);
1016 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1017 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1018 const int scalarSize = glu::getDataTypeScalarSize(type);
1045 FloatBitsToIntCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1054 FloatBitsToUintCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1063 BitsToFloatCase (Context& context, glu::DataType baseType, glu::ShaderType shaderType)
1064 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, glu::PRECISION_HIGHP, shaderType).c_str(), glu::isDataTypeIntOrIVec(baseType) ? "intBitsToFloat" : "uintBitsToFloat", shaderType)
1066 const bool inIsSigned = glu::isDataTypeIntOrIVec(baseType);
1067 const int vecSize = glu::getDataTypeScalarSize(baseType);
1068 const glu::DataType floatType = vecSize > 1 ? glu::getDataTypeFloatVec(vecSize) : glu::TYPE_FLOAT;
1070 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, glu::PRECISION_HIGHP)));
1071 m_spec.outputs.push_back(Symbol("out0", glu::VarType(floatType, glu::PRECISION_HIGHP)));
1078 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1079 const int scalarSize = glu::getDataTypeScalarSize(type);
1088 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1089 const int scalarSize = glu::getDataTypeScalarSize(type);
1113 FloorCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1116 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1117 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1131 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1132 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1133 const int scalarSize = glu::getDataTypeScalarSize(type);
1138 if (precision == glu::PRECISION_MEDIUMP)
1147 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1148 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1149 const int scalarSize = glu::getDataTypeScalarSize(type);
1151 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1209 TruncCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1212 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1213 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1227 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1228 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1229 const int scalarSize = glu::getDataTypeScalarSize(type);
1244 if (precision == glu::PRECISION_MEDIUMP)
1253 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1254 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1255 const int scalarSize = glu::getDataTypeScalarSize(type);
1257 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1317 RoundCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1320 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1321 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1335 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1336 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1337 const int scalarSize = glu::getDataTypeScalarSize(type);
1341 if (precision != glu::PRECISION_LOWP)
1356 if (precision == glu::PRECISION_MEDIUMP)
1365 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1366 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1368 const int scalarSize = glu::getDataTypeScalarSize(type);
1370 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1445 CeilCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1448 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1449 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1463 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1464 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1465 const int scalarSize = glu::getDataTypeScalarSize(type);
1471 if (precision == glu::PRECISION_MEDIUMP)
1480 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1481 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1483 const int scalarSize = glu::getDataTypeScalarSize(type);
1485 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1550 FractCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1553 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1554 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1568 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1569 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1570 const int scalarSize = glu::getDataTypeScalarSize(type);
1574 if (precision != glu::PRECISION_LOWP)
1589 if (precision == glu::PRECISION_MEDIUMP)
1598 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1599 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1601 const int scalarSize = glu::getDataTypeScalarSize(type);
1603 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1693 FrexpCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1696 const int vecSize = glu::getDataTypeScalarSize(baseType);
1697 const glu::DataType intType = vecSize > 1 ? glu::getDataTypeIntVec(vecSize) : glu::TYPE_INT;
1699 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1700 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, glu::PRECISION_HIGHP)));
1701 m_spec.outputs.push_back(Symbol("out1", glu::VarType(intType, glu::PRECISION_HIGHP)));
1715 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1716 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1717 const int scalarSize = glu::getDataTypeScalarSize(type);
1737 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1738 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1739 const int scalarSize = glu::getDataTypeScalarSize(type);
1773 LdexpCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1776 const int vecSize = glu::getDataTypeScalarSize(baseType);
1777 const glu::DataType intType = vecSize > 1 ? glu::getDataTypeIntVec(vecSize) : glu::TYPE_INT;
1779 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1780 m_spec.inputs.push_back(Symbol("in1", glu::VarType(intType, glu::PRECISION_HIGHP)));
1781 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, glu::PRECISION_HIGHP)));
1795 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1796 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1797 const int scalarSize = glu::getDataTypeScalarSize(type);
1823 const int numEasyRandomCases = precision == glu::PRECISION_HIGHP ? 50 : (numValues-valueNdx);
1877 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1878 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1879 const int scalarSize = glu::getDataTypeScalarSize(type);
1909 FmaCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1912 m_spec.inputs.push_back(Symbol("a", glu::VarType(baseType, precision)));
1913 m_spec.inputs.push_back(Symbol("b", glu::VarType(baseType, precision)));
1914 m_spec.inputs.push_back(Symbol("c", glu::VarType(baseType, precision)));
1915 m_spec.outputs.push_back(Symbol("res", glu::VarType(baseType, precision)));
1938 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1939 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1940 const int scalarSize = glu::getDataTypeScalarSize(type);
1981 if (precision != glu::PRECISION_HIGHP)
2024 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
2025 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
2026 const int scalarSize = glu::getDataTypeScalarSize(type);
2071 const glu::DataType scalarTypes[] =
2073 glu::TYPE_FLOAT,
2074 glu::TYPE_INT,
2075 glu::TYPE_UINT
2080 const glu::DataType scalarType = scalarTypes[scalarTypeNdx];
2082 if ((!floatTypes && scalarType == glu::TYPE_FLOAT) ||
2083 (!intTypes && scalarType == glu::TYPE_INT) ||
2084 (!uintTypes && scalarType == glu::TYPE_UINT))
2089 for (int prec = glu::PRECISION_LOWP; prec <= glu::PRECISION_HIGHP; prec++)
2091 for (int shaderTypeNdx = 0; shaderTypeNdx < glu::SHADERTYPE_LAST; shaderTypeNdx++)
2094 group->addChild(new TestClass(parent->getContext(), glu::DataType(scalarType + vecSize - 1), glu::Precision(prec), glu::ShaderType(shaderTypeNdx)));
2105 VS = (1<<glu::SHADERTYPE_VERTEX),
2106 TC = (1<<glu::SHADERTYPE_TESSELLATION_CONTROL),
2107 TE = (1<<glu::SHADERTYPE_TESSELLATION_EVALUATION),
2108 GS = (1<<glu::SHADERTYPE_GEOMETRY),
2109 FS = (1<<glu::SHADERTYPE_FRAGMENT),
2110 CS = (1<<glu::SHADERTYPE_COMPUTE),
2153 const glu::DataType intType = vecSize > 1 ? glu::getDataTypeIntVec(vecSize) : glu::TYPE_INT;
2154 const glu::DataType uintType = vecSize > 1 ? glu::getDataTypeUintVec(vecSize) : glu::TYPE_UINT;
2156 for (int shaderType = 0; shaderType < glu::SHADERTYPE_LAST; shaderType++)
2160 intGroup->addChild(new BitsToFloatCase(m_context, intType, glu::ShaderType(shaderType)));
2161 uintGroup->addChild(new BitsToFloatCase(m_context, uintType, glu::ShaderType(shaderType)));