• Home
  • Raw
  • Download

Lines Matching refs:glu

63 using glu::ShaderProgram;
64 using glu::StructType;
68 typedef bool (* dataTypePredicate)(glu::DataType);
74 static const glu::DataType s_testDataTypes[] =
76 glu::TYPE_FLOAT,
77 glu::TYPE_FLOAT_VEC2,
78 glu::TYPE_FLOAT_VEC3,
79 glu::TYPE_FLOAT_VEC4,
80 glu::TYPE_FLOAT_MAT2,
81 glu::TYPE_FLOAT_MAT3,
82 glu::TYPE_FLOAT_MAT4,
84 glu::TYPE_INT,
85 glu::TYPE_INT_VEC2,
86 glu::TYPE_INT_VEC3,
87 glu::TYPE_INT_VEC4,
89 glu::TYPE_BOOL,
90 glu::TYPE_BOOL_VEC2,
91 glu::TYPE_BOOL_VEC3,
92 glu::TYPE_BOOL_VEC4,
94 glu::TYPE_SAMPLER_2D,
95 glu::TYPE_SAMPLER_CUBE
126 static inline int getSamplerNumLookupDimensions (const glu::DataType type) in getSamplerNumLookupDimensions()
130 case glu::TYPE_SAMPLER_2D: in getSamplerNumLookupDimensions()
133 case glu::TYPE_SAMPLER_CUBE: in getSamplerNumLookupDimensions()
142 template<glu::DataType T>
143 static bool dataTypeEquals (const glu::DataType t) in dataTypeEquals()
149 static bool dataTypeIsMatrixWithNRows (const glu::DataType t) in dataTypeIsMatrixWithNRows()
151 return glu::isDataTypeMatrix(t) && glu::getDataTypeMatrixNumRows(t) == N; in dataTypeIsMatrixWithNRows()
154 static bool typeContainsMatchingBasicType (const glu::VarType& type, const dataTypePredicate predic… in typeContainsMatchingBasicType()
171 static void getDistinctSamplerTypes (vector<glu::DataType>& dst, const glu::VarType& type) in getDistinctSamplerTypes()
175 const glu::DataType basicType = type.getBasicType(); in getDistinctSamplerTypes()
176 …if (glu::isDataTypeSampler(basicType) && std::find(dst.begin(), dst.end(), basicType) == dst.end()) in getDistinctSamplerTypes()
190 static int getNumSamplersInType (const glu::VarType& type) in getNumSamplersInType()
193 return glu::isDataTypeSampler(type.getBasicType()) ? 1 : 0; in getNumSamplersInType()
207 static glu::VarType generateRandomType (const int maxDepth, int& curStructIdx, vector<const StructT… in generateRandomType()
221 …return isArray ? glu::VarType(glu::VarType(structType), rnd.getInt(1, 5)) : glu::VarType(structTyp… in generateRandomType()
225 …const glu::DataType basicType = (glu::DataType)s_testDataTypes[rnd.getInt(0, DE_LENGTH_OF_ARRAY(s… in generateRandomType()
226 …const glu::Precision precision = glu::isDataTypeBoolOrBVec(basicType) ? glu::PRECISION_LAST : glu:… in generateRandomType()
227 …return isArray ? glu::VarType(glu::VarType(basicType, precision), rnd.getInt(1, 5)) : glu::VarType… in generateRandomType()
236 glu::DataType type;
263 glu::VarType type;
265 Uniform (const char* const name_, const glu::VarType& type_) : name(name_), type(type_) {} in Uniform()
308 vector<glu::DataType> getSamplerTypes (void) const in getSamplerTypes()
310 vector<glu::DataType> samplerTypes; in getSamplerTypes()
329 static UniformCollection* basic (const glu::DataType type, const char* const nameSuffix = "") in basic()
332 …const glu::Precision prec = glu::isDataTypeBoolOrBVec(type) ? glu::PRECISION_LAST : glu::PRECISIO… in basic()
333 …res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(type, prec)… in basic()
337 static UniformCollection* basicArray (const glu::DataType type, const char* const nameSuffix = "") in basicArray()
340 …const glu::Precision prec = glu::isDataTypeBoolOrBVec(type) ? glu::PRECISION_LAST : glu::PRECISIO… in basicArray()
341 …res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(glu::VarTyp… in basicArray()
345 …static UniformCollection* basicStruct (const glu::DataType type0, const glu::DataType type1, const… in basicStruct()
348 …const glu::Precision prec0 = glu::isDataTypeBoolOrBVec(type0) ? glu::PRECISION_LAST : glu::PRECIS… in basicStruct()
349 …const glu::Precision prec1 = glu::isDataTypeBoolOrBVec(type1) ? glu::PRECISION_LAST : glu::PRECIS… in basicStruct()
352 structType->addMember("m0", glu::VarType(type0, prec0)); in basicStruct()
353 structType->addMember("m1", glu::VarType(type1, prec1)); in basicStruct()
356 structType->addMember("m2", glu::VarType(glu::VarType(type0, prec0), 3)); in basicStruct()
357 structType->addMember("m3", glu::VarType(glu::VarType(type1, prec1), 3)); in basicStruct()
361 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType))); in basicStruct()
366 …static UniformCollection* structInArray (const glu::DataType type0, const glu::DataType type1, con… in structInArray()
369 res->getUniform(0).type = glu::VarType(res->getUniform(0).type, 3); in structInArray()
373 …static UniformCollection* nestedArraysStructs (const glu::DataType type0, const glu::DataType type… in nestedArraysStructs()
376 …const glu::Precision prec0 = glu::isDataTypeBoolOrBVec(type0) ? glu::PRECISION_LAST : glu::PRECI… in nestedArraysStructs()
377 …const glu::Precision prec1 = glu::isDataTypeBoolOrBVec(type1) ? glu::PRECISION_LAST : glu::PRECI… in nestedArraysStructs()
382 subSubStructType->addMember("mss0", glu::VarType(type0, prec0)); in nestedArraysStructs()
383 subSubStructType->addMember("mss1", glu::VarType(type1, prec1)); in nestedArraysStructs()
385 subStructType->addMember("ms0", glu::VarType(type1, prec1)); in nestedArraysStructs()
386 subStructType->addMember("ms1", glu::VarType(glu::VarType(type0, prec0), 2)); in nestedArraysStructs()
387 subStructType->addMember("ms2", glu::VarType(glu::VarType(subSubStructType), 2)); in nestedArraysStructs()
389 structType->addMember("m0", glu::VarType(type0, prec0)); in nestedArraysStructs()
390 structType->addMember("m1", glu::VarType(subStructType)); in nestedArraysStructs()
391 structType->addMember("m2", glu::VarType(type1, prec1)); in nestedArraysStructs()
397 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType))); in nestedArraysStructs()
404 …static const glu::DataType types[] = { glu::TYPE_FLOAT, glu::TYPE_INT_VEC3, glu::TYPE_FLOAT_MAT3, in multipleBasic()
419 static const glu::DataType types[] = { glu::TYPE_FLOAT, glu::TYPE_INT_VEC3, glu::TYPE_BOOL_VEC2 }; in multipleBasicArray()
434 static const glu::DataType types0[] = { glu::TYPE_FLOAT, glu::TYPE_INT, glu::TYPE_BOOL_VEC4 }; in multipleNestedArraysStructs()
435 …static const glu::DataType types1[] = { glu::TYPE_FLOAT_VEC4, glu::TYPE_INT_VEC4, glu::TYPE_BOOL }; in multipleNestedArraysStructs()
460 Uniform uniform(("u_var" + de::toString(i)).c_str(), glu::VarType()); in random()
494 DE_ASSERT(glu::isDataTypeSampler(sampler.type)); in getSamplerFillValue()
497 result.type = glu::TYPE_FLOAT_VEC4; in getSamplerFillValue()
507 DE_ASSERT(glu::isDataTypeSampler(sampler.type)); in getSamplerUnitValue()
510 result.type = glu::TYPE_INT; in getSamplerUnitValue()
518 const int numElems = glu::getDataTypeScalarSize(value.type); in shaderVarValueStr()
522 result << glu::getDataTypeName(value.type) << "("; in shaderVarValueStr()
529 if (glu::isDataTypeFloatOrVec(value.type) || glu::isDataTypeMatrix(value.type)) in shaderVarValueStr()
531 else if (glu::isDataTypeIntOrIVec((value.type))) in shaderVarValueStr()
533 else if (glu::isDataTypeBoolOrBVec((value.type))) in shaderVarValueStr()
535 else if (glu::isDataTypeSampler((value.type))) in shaderVarValueStr()
549 const int numElems = glu::getDataTypeScalarSize(value.type); in apiVarValueStr()
560 if (glu::isDataTypeFloatOrVec(value.type) || glu::isDataTypeMatrix(value.type)) in apiVarValueStr()
562 else if (glu::isDataTypeIntOrIVec((value.type))) in apiVarValueStr()
564 else if (glu::isDataTypeBoolOrBVec((value.type))) in apiVarValueStr()
566 else if (glu::isDataTypeSampler((value.type))) in apiVarValueStr()
578 static VarValue generateRandomVarValue (const glu::DataType type, Random& rnd, int samplerUnit = -1… in generateRandomVarValue()
580 const int numElems = glu::getDataTypeScalarSize(type); in generateRandomVarValue()
584 DE_ASSERT((samplerUnit >= 0) == (glu::isDataTypeSampler(type))); in generateRandomVarValue()
586 if (glu::isDataTypeFloatOrVec(type) || glu::isDataTypeMatrix(type)) in generateRandomVarValue()
591 else if (glu::isDataTypeIntOrIVec(type)) in generateRandomVarValue()
596 else if (glu::isDataTypeBoolOrBVec(type)) in generateRandomVarValue()
601 else if (glu::isDataTypeSampler(type)) in generateRandomVarValue()
614 static VarValue generateZeroVarValue (const glu::DataType type) in generateZeroVarValue()
616 const int numElems = glu::getDataTypeScalarSize(type); in generateZeroVarValue()
620 if (glu::isDataTypeFloatOrVec(type) || glu::isDataTypeMatrix(type)) in generateZeroVarValue()
625 else if (glu::isDataTypeIntOrIVec(type)) in generateZeroVarValue()
630 else if (glu::isDataTypeBoolOrBVec(type)) in generateZeroVarValue()
635 else if (glu::isDataTypeSampler(type)) in generateZeroVarValue()
650 const int size = glu::getDataTypeScalarSize(a.type); in apiVarValueEquals()
655 if (glu::isDataTypeFloatOrVec(a.type) || glu::isDataTypeMatrix(a.type)) in apiVarValueEquals()
661 else if (glu::isDataTypeIntOrIVec(a.type)) in apiVarValueEquals()
667 else if (glu::isDataTypeBoolOrBVec(a.type)) in apiVarValueEquals()
673 else if (glu::isDataTypeSampler(a.type)) in apiVarValueEquals()
684 static VarValue getRandomBoolRepresentation (const VarValue& boolValue, const glu::DataType targetS… in getRandomBoolRepresentation()
686 DE_ASSERT(glu::isDataTypeBoolOrBVec(boolValue.type)); in getRandomBoolRepresentation()
688 const int size = glu::getDataTypeScalarSize(boolValue.type); in getRandomBoolRepresentation()
689 …const glu::DataType targetType = size == 1 ? targetScalarType : glu::getDataTypeVector(targetScal… in getRandomBoolRepresentation()
695 case glu::TYPE_INT: in getRandomBoolRepresentation()
709 case glu::TYPE_FLOAT: in getRandomBoolRepresentation()
748 class UniformCase : public TestCase, protected glu::CallLogWrapper
791 glu::DataType type;
800 const glu::DataType type_, in BasicUniform()
834 glu::DataType type;
837 …BasicUniformReportRef (const char* const name_, const int minS, const int maxS, const glu::DataTyp… in BasicUniformReportRef()
839 BasicUniformReportRef (const char* const name_, const glu::DataType type_, const bool used) in BasicUniformReportRef()
849 glu::DataType type;
853 …BasicUniformReportGL (const char* const name_, const int nameLength_, const int size_, const glu::… in BasicUniformReportGL()
892 const glu::VarType& varType,
909 vector<glu::Texture2D*> m_textures2d;
910 vector<glu::TextureCube*> m_texturesCube;
1011 …cUniformsDst, vector<BasicUniformReportRef>& basicUniformReportsDst, const glu::VarType& varType, … in generateBasicUniforms()
1016 const glu::DataType type = varType.getBasicType(); in generateBasicUniforms()
1018 … : glu::isDataTypeSampler(type) ? generateRandomVarValue(type, rnd, samplerUnitCounter++) in generateBasicUniforms()
1042 const glu::DataType elemBasicType = varType.getElementType().getBasicType(); in generateBasicUniforms()
1044 …: glu::isDataTypeSampler(elemBasicType) ? generateRandomVarValue(elemBasicType, rnd, samplerUnitC… in generateBasicUniforms()
1069 const glu::StructMember& member = structType.getMember(i); in generateBasicUniforms()
1080 dst << glu::declare(m_uniformCollection->getStructType(i)) << ";\n"; in writeUniformDefinitions()
1083 …dst << "uniform " << glu::declare(m_uniformCollection->getUniform(i).type, m_uniformCollection->ge… in writeUniformDefinitions()
1094 …{ { glu::isDataTypeFloatOrVec, glu::isDataTypeMatrix }, "mediump float compare_float (med… in writeUniformDefinitions()
1095 …{ { dataTypeEquals<glu::TYPE_FLOAT_VEC2>, dataTypeIsMatrixWithNRows<2> }, "mediump float compare_… in writeUniformDefinitions()
1096 …{ { dataTypeEquals<glu::TYPE_FLOAT_VEC3>, dataTypeIsMatrixWithNRows<3> }, "mediump float compare_… in writeUniformDefinitions()
1097 …{ { dataTypeEquals<glu::TYPE_FLOAT_VEC4>, dataTypeIsMatrixWithNRows<4> }, "mediump float compare_… in writeUniformDefinitions()
1098 …{ { dataTypeEquals<glu::TYPE_FLOAT_MAT2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float comp… in writeUniformDefinitions()
1099 …{ { dataTypeEquals<glu::TYPE_FLOAT_MAT3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float comp… in writeUniformDefinitions()
1100 …{ { dataTypeEquals<glu::TYPE_FLOAT_MAT4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float comp… in writeUniformDefinitions()
1101 …{ { dataTypeEquals<glu::TYPE_INT>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_i… in writeUniformDefinitions()
1102 …{ { dataTypeEquals<glu::TYPE_INT_VEC2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compa… in writeUniformDefinitions()
1103 …{ { dataTypeEquals<glu::TYPE_INT_VEC3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compa… in writeUniformDefinitions()
1104 …{ { dataTypeEquals<glu::TYPE_INT_VEC4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compa… in writeUniformDefinitions()
1105 …{ { dataTypeEquals<glu::TYPE_BOOL>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_… in writeUniformDefinitions()
1106 …{ { dataTypeEquals<glu::TYPE_BOOL_VEC2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compa… in writeUniformDefinitions()
1107 …{ { dataTypeEquals<glu::TYPE_BOOL_VEC3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compa… in writeUniformDefinitions()
1108 …{ { dataTypeEquals<glu::TYPE_BOOL_VEC4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compa… in writeUniformDefinitions()
1116 … containsTypeSampler = containsSamplers && (typeReq[0](glu::TYPE_FLOAT_VEC4) || typeReq[1](glu::… in writeUniformDefinitions()
1126 if (glu::isDataTypeSampler(uniform.type)) in writeUniformCompareExpr()
1129 << (uniform.type == glu::TYPE_SAMPLER_2D ? "texture2D" : "textureCube") in writeUniformCompareExpr()
1133 dst << "compare_" << glu::getDataTypeName(uniform.type) << "(" << uniform.name; in writeUniformCompareExpr()
1214 if (value.type == glu::TYPE_SAMPLER_2D) in setupTexture()
1216glu::Texture2D* texture = new glu::Texture2D(m_context.getRenderContext(), GL_RGBA, GL_UNSIGNED_B… in setupTexture()
1231 else if (value.type == glu::TYPE_SAMPLER_CUBE) in setupTexture()
1235glu::TextureCube* texture = new glu::TextureCube(m_context.getRenderContext(), GL_RGBA, GL_UNSIGN… in setupTexture()
1283 const glu::DataType reportedType = glu::getDataTypeFromGLType(reportedTypeGL); in getActiveUniforms()
1286 TCU_CHECK_MSG(reportedType != glu::TYPE_LAST, "Invalid uniform type"); in getActiveUniforms()
1288 …= " << reportedNameLength << ", size = " << reportedSize << ", type = " << glu::getDataTypeName(re… in getActiveUniforms()
1314 DE_ASSERT(reference.type != glu::TYPE_LAST); in getActiveUniforms()
1328 …log << TestLog::Message << "// FAILURE: wrong type reported, should be " << glu::getDataTypeName(r… in getActiveUniforms()
1367 const int size = glu::getDataTypeScalarSize(uniform.type); in getUniforms()
1374 value.type = glu::TYPE_INVALID; in getUniforms()
1389 if (glu::isDataTypeFloatOrVec(uniform.type) || glu::isDataTypeMatrix(uniform.type)) in getUniforms()
1391 else if (glu::isDataTypeIntOrIVec(uniform.type)) in getUniforms()
1393 else if (glu::isDataTypeBoolOrBVec(uniform.type)) in getUniforms()
1408 else if (glu::isDataTypeSampler(uniform.type)) in getUniforms()
1436 const int valSize = glu::getDataTypeScalarSize(uniform.type); in checkUniformDefaultValues()
1440 if (unifValue.type == glu::TYPE_INVALID) // This happens when glGetUniformLocation() returned -1. in checkUniformDefaultValues()
1456 if (glu::isDataTypeFloatOrVec(uniform.type) || glu::isDataTypeMatrix(uniform.type)) in checkUniformDefaultValues()
1458 else if (glu::isDataTypeIntOrIVec(uniform.type)) in checkUniformDefaultValues()
1460 else if (glu::isDataTypeBoolOrBVec(uniform.type)) in checkUniformDefaultValues()
1462 else if (glu::isDataTypeSampler(uniform.type)) in checkUniformDefaultValues()
1482 const glu::DataType boolApiType = m_features & FEATURE_BOOLEANAPITYPE_INT ? glu::TYPE_INT in assignUniforms()
1483 : glu::TYPE_FLOAT; in assignUniforms()
1505 const int typeSize = glu::getDataTypeScalarSize(uniform.type); in assignUniforms()
1506 …const bool assignByValue = m_features & FEATURE_UNIFORMFUNC_VALUE && !glu::isDataTypeMatrix(uni… in assignUniforms()
1524 …const VarValue apiValue = glu::isDataTypeBoolOrBVec(unifValue.type) ? getRandomBoolRepresentation(… in assignUniforms()
1525 : glu::isDataTypeSampler(unifValue.type) ? getSamplerUnitValue(unifValue) in assignUniforms()
1530 if (glu::isDataTypeBoolOrBVec(uniform.type)) in assignUniforms()
1531 …log << TestLog::Message << "// Using type " << glu::getDataTypeName(boolApiType) << " to set boole… in assignUniforms()
1532 else if (glu::isDataTypeSampler(uniform.type)) in assignUniforms()
1538 if (glu::isDataTypeFloatOrVec(valuesToAssign[0].type)) in assignUniforms()
1572 else if (glu::isDataTypeMatrix(valuesToAssign[0].type)) in assignUniforms()
1582 …case glu::TYPE_FLOAT_MAT2: GLU_CHECK_CALL(glUniformMatrix2fv(location, (GLsizei)valuesToAssign.siz… in assignUniforms()
1583 …case glu::TYPE_FLOAT_MAT3: GLU_CHECK_CALL(glUniformMatrix3fv(location, (GLsizei)valuesToAssign.siz… in assignUniforms()
1584 …case glu::TYPE_FLOAT_MAT4: GLU_CHECK_CALL(glUniformMatrix4fv(location, (GLsizei)valuesToAssign.siz… in assignUniforms()
1589 else if (glu::isDataTypeIntOrIVec(valuesToAssign[0].type)) in assignUniforms()
1623 else if (glu::isDataTypeSampler(valuesToAssign[0].type)) in assignUniforms()
1650 if (unifValue.type == glu::TYPE_INVALID) // This happens when glGetUniformLocation() returned -1. in compareUniformValues()
1676 if (glu::isDataTypeSampler(basicUniforms[i].type)) in renderTest()
1680 …if (glu::isDataTypeSampler(basicUniforms[j].type) && basicUniforms[i].type != basicUniforms[j].typ… in renderTest()
1688 …if (glu::isDataTypeSampler(basicUniforms[i].type) && std::find(m_filledTextureUnits.begin(), m_fil… in renderTest()
1715 glu::readPixels(m_context.getRenderContext(), viewportX, viewportY, renderedImg.getAccess()); in renderTest()
1755 …const ShaderProgram program (m_context.getRenderContext(), glu::makeVtxFragSources(vertexSour… in iterate()
2130 const glu::DataType dataType = s_testDataTypes[dataTypeNdx]; in init()
2131 const char* const typeName = glu::getDataTypeName(dataType); in init()
2135 if (glu::isDataTypeScalar(dataType) || in init()
2136 (glu::isDataTypeVector(dataType) && glu::getDataTypeScalarSize(dataType) == 4) || in init()
2137 dataType == glu::TYPE_FLOAT_MAT4 || in init()
2138 dataType == glu::TYPE_SAMPLER_2D) in init()
2141 if (glu::isDataTypeScalar(dataType) || in init()
2142 dataType == glu::TYPE_FLOAT_MAT4 || in init()
2143 dataType == glu::TYPE_SAMPLER_2D) in init()
2145 …const glu::DataType secondDataType = glu::isDataTypeScalar(dataType) ? glu::getDataTypeVector(dat… in init()
2146 : dataType == glu::TYPE_FLOAT_MAT4 ? glu::TYPE_FLOAT_MAT2 in init()
2147 : dataType == glu::TYPE_SAMPLER_2D ? glu::TYPE_SAMPLER_CUBE in init()
2148 : glu::TYPE_LAST; in init()
2149 DE_ASSERT(secondDataType != glu::TYPE_LAST); in init()
2150 const char* const secondTypeName = glu::getDataTypeName(secondDataType); in init()
2244 …const bool containsBooleans = uniformCollection->containsMatchingBasicType(glu::isDataType… in init()
2307 …const bool containsBooleans = uniformCollection->containsMatchingBasicType(glu::isDataType… in init()
2311 …const bool containsMatrices = uniformCollection->containsMatchingBasicType(glu::isDataType… in init()