Lines Matching refs:glu

114 inline bool supportsSignedZero (glu::Precision precision)
118 return precision == glu::PRECISION_HIGHP;
140 static int getMinMantissaBits (glu::Precision precision)
148 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(bits) == glu::PRECISION_LAST);
153 static int getMaxNormalizedValueExponent (glu::Precision precision)
161 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(exponent) == glu::PRECISION_LAST);
166 static int getMinNormalizedValueExponent (glu::Precision precision)
174 DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(exponent) == glu::PRECISION_LAST);
179 static float makeFloatRepresentable (float f, glu::Precision precision)
181 if (precision == glu::PRECISION_HIGHP)
193 const bool zeroNotRepresentable = (precision == glu::PRECISION_LOWP);
227 CommonFunctionCase (Context& context, const char* name, const char* description, glu::ShaderType shaderType);
241 glu::ShaderType m_shaderType;
251 CommonFunctionCase::CommonFunctionCase (Context& context, const char* name, const char* description, glu::ShaderType shaderType)
268 glu::ContextType contextType = m_context.getRenderContext().getType();
269 m_spec.version = glu::getContextTypeGLSLVersion(contextType);
320 // \todo [2013-08-08 pyry] Make generic utility and move to glu?
346 const glu::VarType& type;
349 VarValue (const glu::VarType& type_, const void* value_) : type(type_), value(value_) {}
356 const glu::DataType basicType = varValue.type.getBasicType();
357 const glu::DataType scalarType = glu::getDataTypeScalarType(basicType);
358 const int numComponents = glu::getDataTypeScalarSize(basicType);
361 str << glu::getDataTypeName(basicType) << "(";
370 case glu::TYPE_FLOAT: str << HexFloat(((const float*)varValue.value)[compNdx]); break;
371 case glu::TYPE_INT: str << ((const deInt32*)varValue.value)[compNdx]; break;
372 case glu::TYPE_UINT: str << tcu::toHex(((const deUint32*)varValue.value)[compNdx]); break;
373 case glu::TYPE_BOOL: str << HexBool(((const deUint32*)varValue.value)[compNdx]); break;
452 static std::string getCommonFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
454 return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
460 AbsCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
463 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
464 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
484 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
485 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
486 const int scalarSize = glu::getDataTypeScalarSize(type);
488 if (glu::isDataTypeFloatOrVec(type))
496 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
497 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
498 const int scalarSize = glu::getDataTypeScalarSize(type);
500 if (glu::isDataTypeFloatOrVec(type))
542 SignCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
545 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
546 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
566 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
567 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
568 const int scalarSize = glu::getDataTypeScalarSize(type);
570 if (glu::isDataTypeFloatOrVec(type))
589 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
590 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
591 const int scalarSize = glu::getDataTypeScalarSize(type);
593 if (glu::isDataTypeFloatOrVec(type))
596 const deUint32 maxUlpDiff = precision == glu::PRECISION_LOWP ? getMaxUlpDiffFromBits(getMinMantissaBits(precision)) : 0;
648 RoundEvenCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
651 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
652 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
666 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
667 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
668 const int scalarSize = glu::getDataTypeScalarSize(type);
672 if (precision != glu::PRECISION_LOWP)
687 if (precision == glu::PRECISION_MEDIUMP)
696 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
697 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
699 const int scalarSize = glu::getDataTypeScalarSize(type);
701 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
759 ModfCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
762 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
763 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
764 m_spec.outputs.push_back(Symbol("out1", glu::VarType(baseType, precision)));
778 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
779 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
780 const int scalarSize = glu::getDataTypeScalarSize(type);
787 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
788 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
790 const int scalarSize = glu::getDataTypeScalarSize(type);
803 const int bitsLost = precision != glu::PRECISION_HIGHP ? numBitsLostInOp(in0, refOut0) : 0;
825 IsnanCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
828 DE_ASSERT(glu::isDataTypeFloatOrVec(baseType));
830 const int vecSize = glu::getDataTypeScalarSize(baseType);
831 const glu::DataType boolType = vecSize > 1 ? glu::getDataTypeBoolVec(vecSize) : glu::TYPE_BOOL;
833 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
834 m_spec.outputs.push_back(Symbol("out0", glu::VarType(boolType, glu::PRECISION_LAST)));
841 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
842 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
843 const int scalarSize = glu::getDataTypeScalarSize(type);
864 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
865 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
866 const int scalarSize = glu::getDataTypeScalarSize(type);
868 if (precision == glu::PRECISION_HIGHP)
884 else if (precision == glu::PRECISION_MEDIUMP || precision == glu::PRECISION_LOWP)
908 IsinfCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
911 DE_ASSERT(glu::isDataTypeFloatOrVec(baseType));
913 const int vecSize = glu::getDataTypeScalarSize(baseType);
914 const glu::DataType boolType = vecSize > 1 ? glu::getDataTypeBoolVec(vecSize) : glu::TYPE_BOOL;
916 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
917 m_spec.outputs.push_back(Symbol("out0", glu::VarType(boolType, glu::PRECISION_LAST)));
924 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
925 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
926 const int scalarSize = glu::getDataTypeScalarSize(type);
947 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
948 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
949 const int scalarSize = glu::getDataTypeScalarSize(type);
951 if (precision == glu::PRECISION_HIGHP)
967 else if (precision == glu::PRECISION_MEDIUMP)
992 FloatBitsToUintIntCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType, bool outIsSigned)
995 const int vecSize = glu::getDataTypeScalarSize(baseType);
996 const glu::DataType intType = outIsSigned ? (vecSize > 1 ? glu::getDataTypeIntVec(vecSize) : glu::TYPE_INT)
997 : (vecSize > 1 ? glu::getDataTypeUintVec(vecSize) : glu::TYPE_UINT);
999 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1000 m_spec.outputs.push_back(Symbol("out0", glu::VarType(intType, glu::PRECISION_HIGHP)));
1014 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1015 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1016 const int scalarSize = glu::getDataTypeScalarSize(type);
1023 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1024 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1025 const int scalarSize = glu::getDataTypeScalarSize(type);
1052 FloatBitsToIntCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1061 FloatBitsToUintCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1070 BitsToFloatCase (Context& context, glu::DataType baseType, glu::ShaderType shaderType)
1071 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, glu::PRECISION_HIGHP, shaderType).c_str(), glu::isDataTypeIntOrIVec(baseType) ? "intBitsToFloat" : "uintBitsToFloat", shaderType)
1073 const bool inIsSigned = glu::isDataTypeIntOrIVec(baseType);
1074 const int vecSize = glu::getDataTypeScalarSize(baseType);
1075 const glu::DataType floatType = vecSize > 1 ? glu::getDataTypeFloatVec(vecSize) : glu::TYPE_FLOAT;
1077 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, glu::PRECISION_HIGHP)));
1078 m_spec.outputs.push_back(Symbol("out0", glu::VarType(floatType, glu::PRECISION_HIGHP)));
1085 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1086 const int scalarSize = glu::getDataTypeScalarSize(type);
1095 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1096 const int scalarSize = glu::getDataTypeScalarSize(type);
1120 FloorCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1123 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1124 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1138 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1139 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1140 const int scalarSize = glu::getDataTypeScalarSize(type);
1145 if (precision == glu::PRECISION_MEDIUMP)
1154 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1155 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1156 const int scalarSize = glu::getDataTypeScalarSize(type);
1158 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1216 TruncCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1219 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1220 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1234 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1235 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1236 const int scalarSize = glu::getDataTypeScalarSize(type);
1251 if (precision == glu::PRECISION_MEDIUMP)
1260 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1261 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1262 const int scalarSize = glu::getDataTypeScalarSize(type);
1264 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1324 RoundCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1327 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1328 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1342 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1343 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1344 const int scalarSize = glu::getDataTypeScalarSize(type);
1348 if (precision != glu::PRECISION_LOWP)
1363 if (precision == glu::PRECISION_MEDIUMP)
1372 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1373 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1375 const int scalarSize = glu::getDataTypeScalarSize(type);
1377 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1452 CeilCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1455 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1456 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1470 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1471 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1472 const int scalarSize = glu::getDataTypeScalarSize(type);
1478 if (precision == glu::PRECISION_MEDIUMP)
1487 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1488 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1490 const int scalarSize = glu::getDataTypeScalarSize(type);
1492 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1557 FractCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1560 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1561 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1575 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1576 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1577 const int scalarSize = glu::getDataTypeScalarSize(type);
1581 if (precision != glu::PRECISION_LOWP)
1596 if (precision == glu::PRECISION_MEDIUMP)
1605 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1606 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1608 const int scalarSize = glu::getDataTypeScalarSize(type);
1610 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1700 FrexpCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1703 const int vecSize = glu::getDataTypeScalarSize(baseType);
1704 const glu::DataType intType = vecSize > 1 ? glu::getDataTypeIntVec(vecSize) : glu::TYPE_INT;
1706 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1707 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, glu::PRECISION_HIGHP)));
1708 m_spec.outputs.push_back(Symbol("out1", glu::VarType(intType, glu::PRECISION_HIGHP)));
1722 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1723 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1724 const int scalarSize = glu::getDataTypeScalarSize(type);
1755 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1756 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1757 const int scalarSize = glu::getDataTypeScalarSize(type);
1791 LdexpCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1794 const int vecSize = glu::getDataTypeScalarSize(baseType);
1795 const glu::DataType intType = vecSize > 1 ? glu::getDataTypeIntVec(vecSize) : glu::TYPE_INT;
1797 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1798 m_spec.inputs.push_back(Symbol("in1", glu::VarType(intType, glu::PRECISION_HIGHP)));
1799 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, glu::PRECISION_HIGHP)));
1813 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1814 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1815 const int scalarSize = glu::getDataTypeScalarSize(type);
1841 const int numEasyRandomCases = precision == glu::PRECISION_HIGHP ? 50 : (numValues-valueNdx);
1895 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1896 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1897 const int scalarSize = glu::getDataTypeScalarSize(type);
1927 FmaCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1930 m_spec.inputs.push_back(Symbol("a", glu::VarType(baseType, precision)));
1931 m_spec.inputs.push_back(Symbol("b", glu::VarType(baseType, precision)));
1932 m_spec.inputs.push_back(Symbol("c", glu::VarType(baseType, precision)));
1933 m_spec.outputs.push_back(Symbol("res", glu::VarType(baseType, precision)));
1936 if (!glu::contextSupports(context.getRenderContext().getType(), glu::ApiType::es(3, 2))
1937 && !glu::contextSupports(context.getRenderContext().getType(), glu::ApiType::core(4, 5)))
1943 if (!glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2))
1945 && !glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5)))
1961 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
1962 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1963 const int scalarSize = glu::getDataTypeScalarSize(type);
2014 static tcu::Interval fma (glu::Precision precision, float a, float b, float c)
2023 const tcu::FloatFormat& format = de::getSizedArrayElement<glu::PRECISION_LAST>(formats, precision);
2050 const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
2051 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
2052 const int scalarSize = glu::getDataTypeScalarSize(type);
2088 const glu::DataType scalarTypes[] =
2090 glu::TYPE_FLOAT,
2091 glu::TYPE_INT,
2092 glu::TYPE_UINT
2097 const glu::DataType scalarType = scalarTypes[scalarTypeNdx];
2099 if ((!floatTypes && scalarType == glu::TYPE_FLOAT) ||
2100 (!intTypes && scalarType == glu::TYPE_INT) ||
2101 (!uintTypes && scalarType == glu::TYPE_UINT))
2106 for (int prec = glu::PRECISION_LOWP; prec <= glu::PRECISION_HIGHP; prec++)
2108 for (int shaderTypeNdx = 0; shaderTypeNdx < glu::SHADERTYPE_LAST; shaderTypeNdx++)
2111 group->addChild(new TestClass(parent->getContext(), glu::DataType(scalarType + vecSize - 1), glu::Precision(prec), glu::ShaderType(shaderTypeNdx)));
2122 VS = (1<<glu::SHADERTYPE_VERTEX),
2123 TC = (1<<glu::SHADERTYPE_TESSELLATION_CONTROL),
2124 TE = (1<<glu::SHADERTYPE_TESSELLATION_EVALUATION),
2125 GS = (1<<glu::SHADERTYPE_GEOMETRY),
2126 FS = (1<<glu::SHADERTYPE_FRAGMENT),
2127 CS = (1<<glu::SHADERTYPE_COMPUTE),
2170 const glu::DataType intType = vecSize > 1 ? glu::getDataTypeIntVec(vecSize) : glu::TYPE_INT;
2171 const glu::DataType uintType = vecSize > 1 ? glu::getDataTypeUintVec(vecSize) : glu::TYPE_UINT;
2173 for (int shaderType = 0; shaderType < glu::SHADERTYPE_LAST; shaderType++)
2177 intGroup->addChild(new BitsToFloatCase(m_context, intType, glu::ShaderType(shaderType)));
2178 uintGroup->addChild(new BitsToFloatCase(m_context, uintType, glu::ShaderType(shaderType)));