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_MAT2X3,
82 glu::TYPE_FLOAT_MAT2X4,
83 glu::TYPE_FLOAT_MAT3X2,
84 glu::TYPE_FLOAT_MAT3,
85 glu::TYPE_FLOAT_MAT3X4,
86 glu::TYPE_FLOAT_MAT4X2,
87 glu::TYPE_FLOAT_MAT4X3,
88 glu::TYPE_FLOAT_MAT4,
90 glu::TYPE_INT,
91 glu::TYPE_INT_VEC2,
92 glu::TYPE_INT_VEC3,
93 glu::TYPE_INT_VEC4,
95 glu::TYPE_UINT,
96 glu::TYPE_UINT_VEC2,
97 glu::TYPE_UINT_VEC3,
98 glu::TYPE_UINT_VEC4,
100 glu::TYPE_BOOL,
101 glu::TYPE_BOOL_VEC2,
102 glu::TYPE_BOOL_VEC3,
103 glu::TYPE_BOOL_VEC4,
105 glu::TYPE_SAMPLER_2D,
106 glu::TYPE_SAMPLER_CUBE
138 static inline int getSamplerNumLookupDimensions (const glu::DataType type)
142 case glu::TYPE_SAMPLER_2D:
143 case glu::TYPE_INT_SAMPLER_2D:
144 case glu::TYPE_UINT_SAMPLER_2D:
147 case glu::TYPE_SAMPLER_3D:
148 case glu::TYPE_INT_SAMPLER_3D:
149 case glu::TYPE_UINT_SAMPLER_3D:
150 case glu::TYPE_SAMPLER_2D_SHADOW:
151 case glu::TYPE_SAMPLER_2D_ARRAY:
152 case glu::TYPE_INT_SAMPLER_2D_ARRAY:
153 case glu::TYPE_UINT_SAMPLER_2D_ARRAY:
154 case glu::TYPE_SAMPLER_CUBE:
155 case glu::TYPE_INT_SAMPLER_CUBE:
156 case glu::TYPE_UINT_SAMPLER_CUBE:
159 case glu::TYPE_SAMPLER_CUBE_SHADOW:
160 case glu::TYPE_SAMPLER_2D_ARRAY_SHADOW:
169 static inline glu::DataType getSamplerLookupReturnType (const glu::DataType type)
173 case glu::TYPE_SAMPLER_2D:
174 case glu::TYPE_SAMPLER_CUBE:
175 case glu::TYPE_SAMPLER_2D_ARRAY:
176 case glu::TYPE_SAMPLER_3D:
177 return glu::TYPE_FLOAT_VEC4;
179 case glu::TYPE_UINT_SAMPLER_2D:
180 case glu::TYPE_UINT_SAMPLER_CUBE:
181 case glu::TYPE_UINT_SAMPLER_2D_ARRAY:
182 case glu::TYPE_UINT_SAMPLER_3D:
183 return glu::TYPE_UINT_VEC4;
185 case glu::TYPE_INT_SAMPLER_2D:
186 case glu::TYPE_INT_SAMPLER_CUBE:
187 case glu::TYPE_INT_SAMPLER_2D_ARRAY:
188 case glu::TYPE_INT_SAMPLER_3D:
189 return glu::TYPE_INT_VEC4;
191 case glu::TYPE_SAMPLER_2D_SHADOW:
192 case glu::TYPE_SAMPLER_CUBE_SHADOW:
193 case glu::TYPE_SAMPLER_2D_ARRAY_SHADOW:
194 return glu::TYPE_FLOAT;
198 return glu::TYPE_LAST;
202 template<glu::DataType T>
203 static bool dataTypeEquals (const glu::DataType t)
209 static bool dataTypeIsMatrixWithNRows (const glu::DataType t)
211 return glu::isDataTypeMatrix(t) && glu::getDataTypeMatrixNumRows(t) == N;
214 static bool typeContainsMatchingBasicType (const glu::VarType& type, const dataTypePredicate predicate)
231 static void getDistinctSamplerTypes (vector<glu::DataType>& dst, const glu::VarType& type)
235 const glu::DataType basicType = type.getBasicType();
236 if (glu::isDataTypeSampler(basicType) && std::find(dst.begin(), dst.end(), basicType) == dst.end())
250 static int getNumSamplersInType (const glu::VarType& type)
253 return glu::isDataTypeSampler(type.getBasicType()) ? 1 : 0;
267 static glu::VarType generateRandomType (const int maxDepth, int& curStructIdx, vector<const StructType*>& structTypesDst, Random& rnd)
281 return isArray ? glu::VarType(glu::VarType(structType), rnd.getInt(1, 5)) : glu::VarType(structType);
285 const glu::DataType basicType = (glu::DataType)s_testDataTypes[rnd.getInt(0, DE_LENGTH_OF_ARRAY(s_testDataTypes)-1)];
286 const glu::Precision precision = glu::isDataTypeBoolOrBVec(basicType) ? glu::PRECISION_LAST : glu::PRECISION_MEDIUMP;
287 return isArray ? glu::VarType(glu::VarType(basicType, precision), rnd.getInt(1, 5)) : glu::VarType(basicType, precision);
296 glu::DataType type;
329 glu::VarType type;
331 Uniform (const char* const name_, const glu::VarType& type_) : name(name_), type(type_) {}
374 vector<glu::DataType> getSamplerTypes (void) const
376 vector<glu::DataType> samplerTypes;
395 static UniformCollection* basic (const glu::DataType type, const char* const nameSuffix = "")
398 const glu::Precision prec = glu::isDataTypeBoolOrBVec(type) ? glu::PRECISION_LAST : glu::PRECISION_MEDIUMP;
399 res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(type, prec)));
403 static UniformCollection* basicArray (const glu::DataType type, const char* const nameSuffix = "")
406 const glu::Precision prec = glu::isDataTypeBoolOrBVec(type) ? glu::PRECISION_LAST : glu::PRECISION_MEDIUMP;
407 res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(glu::VarType(type, prec), 3)));
411 static UniformCollection* basicStruct (const glu::DataType type0, const glu::DataType type1, const bool containsArrays, const char* const nameSuffix = "")
414 const glu::Precision prec0 = glu::isDataTypeBoolOrBVec(type0) ? glu::PRECISION_LAST : glu::PRECISION_MEDIUMP;
415 const glu::Precision prec1 = glu::isDataTypeBoolOrBVec(type1) ? glu::PRECISION_LAST : glu::PRECISION_MEDIUMP;
418 structType->addMember("m0", glu::VarType(type0, prec0));
419 structType->addMember("m1", glu::VarType(type1, prec1));
422 structType->addMember("m2", glu::VarType(glu::VarType(type0, prec0), 3));
423 structType->addMember("m3", glu::VarType(glu::VarType(type1, prec1), 3));
427 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType)));
432 static UniformCollection* structInArray (const glu::DataType type0, const glu::DataType type1, const bool containsArrays, const char* const nameSuffix = "")
435 res->getUniform(0).type = glu::VarType(res->getUniform(0).type, 3);
439 static UniformCollection* nestedArraysStructs (const glu::DataType type0, const glu::DataType type1, const char* const nameSuffix = "")
442 const glu::Precision prec0 = glu::isDataTypeBoolOrBVec(type0) ? glu::PRECISION_LAST : glu::PRECISION_MEDIUMP;
443 const glu::Precision prec1 = glu::isDataTypeBoolOrBVec(type1) ? glu::PRECISION_LAST : glu::PRECISION_MEDIUMP;
448 subSubStructType->addMember("mss0", glu::VarType(type0, prec0));
449 subSubStructType->addMember("mss1", glu::VarType(type1, prec1));
451 subStructType->addMember("ms0", glu::VarType(type1, prec1));
452 subStructType->addMember("ms1", glu::VarType(glu::VarType(type0, prec0), 2));
453 subStructType->addMember("ms2", glu::VarType(glu::VarType(subSubStructType), 2));
455 structType->addMember("m0", glu::VarType(type0, prec0));
456 structType->addMember("m1", glu::VarType(subStructType));
457 structType->addMember("m2", glu::VarType(type1, prec1));
463 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType)));
470 static const glu::DataType types[] = { glu::TYPE_FLOAT, glu::TYPE_INT_VEC3, glu::TYPE_UINT_VEC4, glu::TYPE_FLOAT_MAT3, glu::TYPE_BOOL_VEC2 };
485 static const glu::DataType types[] = { glu::TYPE_FLOAT, glu::TYPE_INT_VEC3, glu::TYPE_BOOL_VEC2 };
500 static const glu::DataType types0[] = { glu::TYPE_FLOAT, glu::TYPE_INT, glu::TYPE_BOOL_VEC4 };
501 static const glu::DataType types1[] = { glu::TYPE_FLOAT_VEC4, glu::TYPE_INT_VEC4, glu::TYPE_BOOL };
526 Uniform uniform(("u_var" + de::toString(i)).c_str(), glu::VarType());
560 DE_ASSERT(glu::isDataTypeSampler(sampler.type));
567 case glu::TYPE_FLOAT_VEC4:
571 case glu::TYPE_UINT_VEC4:
575 case glu::TYPE_INT_VEC4:
579 case glu::TYPE_FLOAT:
591 DE_ASSERT(glu::isDataTypeSampler(sampler.type));
594 result.type = glu::TYPE_INT;
600 static glu::DataType getDataTypeTransposedMatrix (const glu::DataType original)
602 return glu::getDataTypeMatrix(glu::getDataTypeMatrixNumRows(original), glu::getDataTypeMatrixNumColumns(original));
607 DE_ASSERT(glu::isDataTypeMatrix(original.type));
609 const int rows = glu::getDataTypeMatrixNumRows(original.type);
610 const int cols = glu::getDataTypeMatrixNumColumns(original.type);
623 const int numElems = glu::getDataTypeScalarSize(value.type);
627 result << glu::getDataTypeName(value.type) << "(";
634 if (glu::isDataTypeFloatOrVec(value.type) || glu::isDataTypeMatrix(value.type))
636 else if (glu::isDataTypeIntOrIVec((value.type)))
638 else if (glu::isDataTypeUintOrUVec((value.type)))
640 else if (glu::isDataTypeBoolOrBVec((value.type)))
642 else if (glu::isDataTypeSampler((value.type)))
656 const int numElems = glu::getDataTypeScalarSize(value.type);
667 if (glu::isDataTypeFloatOrVec(value.type) || glu::isDataTypeMatrix(value.type))
669 else if (glu::isDataTypeIntOrIVec((value.type)))
671 else if (glu::isDataTypeUintOrUVec((value.type)))
673 else if (glu::isDataTypeBoolOrBVec((value.type)))
675 else if (glu::isDataTypeSampler((value.type)))
687 static VarValue generateRandomVarValue (const glu::DataType type, Random& rnd, int samplerUnit = -1 /* Used if type is a sampler type. \note Samplers' unit numbers are not randomized. */)
689 const int numElems = glu::getDataTypeScalarSize(type);
693 DE_ASSERT((samplerUnit >= 0) == (glu::isDataTypeSampler(type)));
695 if (glu::isDataTypeFloatOrVec(type) || glu::isDataTypeMatrix(type))
700 else if (glu::isDataTypeIntOrIVec(type))
705 else if (glu::isDataTypeUintOrUVec(type))
710 else if (glu::isDataTypeBoolOrBVec(type))
715 else if (glu::isDataTypeSampler(type))
717 const glu::DataType texResultType = getSamplerLookupReturnType(type);
718 const glu::DataType texResultScalarType = glu::getDataTypeScalarType(texResultType);
719 const int texResultNumDims = glu::getDataTypeScalarSize(texResultType);
727 case glu::TYPE_FLOAT: result.val.samplerV.fillColor.floatV[i] = rnd.getFloat(0.0f, 1.0f); break;
728 case glu::TYPE_INT: result.val.samplerV.fillColor.intV[i] = rnd.getInt(-10, 10); break;
729 case glu::TYPE_UINT: result.val.samplerV.fillColor.uintV[i] = (deUint32)rnd.getInt(0, 10); break;
741 static VarValue generateZeroVarValue (const glu::DataType type)
743 const int numElems = glu::getDataTypeScalarSize(type);
747 if (glu::isDataTypeFloatOrVec(type) || glu::isDataTypeMatrix(type))
752 else if (glu::isDataTypeIntOrIVec(type))
757 else if (glu::isDataTypeUintOrUVec(type))
762 else if (glu::isDataTypeBoolOrBVec(type))
767 else if (glu::isDataTypeSampler(type))
769 const glu::DataType texResultType = getSamplerLookupReturnType(type);
770 const glu::DataType texResultScalarType = glu::getDataTypeScalarType(texResultType);
771 const int texResultNumDims = glu::getDataTypeScalarSize(texResultType);
779 case glu::TYPE_FLOAT: result.val.samplerV.fillColor.floatV[i] = 0.12f * (float)i; break;
780 case glu::TYPE_INT: result.val.samplerV.fillColor.intV[i] = -2 + i; break;
781 case glu::TYPE_UINT: result.val.samplerV.fillColor.uintV[i] = 4 + i; break;
795 const int size = glu::getDataTypeScalarSize(a.type);
800 if (glu::isDataTypeFloatOrVec(a.type) || glu::isDataTypeMatrix(a.type))
806 else if (glu::isDataTypeIntOrIVec(a.type))
812 else if (glu::isDataTypeUintOrUVec(a.type))
818 else if (glu::isDataTypeBoolOrBVec(a.type))
824 else if (glu::isDataTypeSampler(a.type))
835 static VarValue getRandomBoolRepresentation (const VarValue& boolValue, const glu::DataType targetScalarType, Random& rnd)
837 DE_ASSERT(glu::isDataTypeBoolOrBVec(boolValue.type));
839 const int size = glu::getDataTypeScalarSize(boolValue.type);
840 const glu::DataType targetType = size == 1 ? targetScalarType : glu::getDataTypeVector(targetScalarType, size);
846 case glu::TYPE_INT:
860 case glu::TYPE_UINT:
870 case glu::TYPE_FLOAT:
909 class UniformCase : public TestCase, protected glu::CallLogWrapper
955 glu::DataType type;
964 const glu::DataType type_,
998 glu::DataType type;
1001 BasicUniformReportRef (const char* const name_, const int minS, const int maxS, const glu::DataType type_, const bool used)
1003 BasicUniformReportRef (const char* const name_, const glu::DataType type_, const bool used)
1013 glu::DataType type;
1017 BasicUniformReportGL (const char* const name_, const int nameLength_, const int size_, const glu::DataType type_, const int index_)
1037 // Get uniform values with glGetUniform*() and put to valuesDst. Uniforms that get -1 from glGetUniformLocation() get glu::TYPE_INVALID.
1060 const glu::VarType& varType,
1077 vector<glu::Texture2D*> m_textures2d;
1078 vector<glu::TextureCube*> m_texturesCube;
1172 void UniformCase::generateBasicUniforms (vector<BasicUniform>& basicUniformsDst, vector<BasicUniformReportRef>& basicUniformReportsDst, const glu::VarType& varType, const char* const varName, const bool isParentActive, int& samplerUnitCounter, Random& rnd) const
1177 const glu::DataType type = varType.getBasicType();
1179 : glu::isDataTypeSampler(type) ? generateRandomVarValue(type, rnd, samplerUnitCounter++)
1203 const glu::DataType elemBasicType = varType.getElementType().getBasicType();
1205 : glu::isDataTypeSampler(elemBasicType) ? generateRandomVarValue(elemBasicType, rnd, samplerUnitCounter++)
1230 const glu::StructMember& member = structType.getMember(i);
1241 dst << glu::declare(m_uniformCollection->getStructType(i)) << ";\n";
1244 dst << "uniform " << glu::declare(m_uniformCollection->getUniform(i).type, m_uniformCollection->getUniform(i).name.c_str()) << ";\n";
1255 { { glu::isDataTypeFloatOrVec, glu::isDataTypeMatrix }, "mediump float compare_float (mediump float a, mediump float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; }" },
1256 { { dataTypeEquals<glu::TYPE_FLOAT_VEC2>, dataTypeIsMatrixWithNRows<2> }, "mediump float compare_vec2 (mediump vec2 a, mediump vec2 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y); }" },
1257 { { dataTypeEquals<glu::TYPE_FLOAT_VEC3>, dataTypeIsMatrixWithNRows<3> }, "mediump float compare_vec3 (mediump vec3 a, mediump vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); }" },
1258 { { dataTypeEquals<glu::TYPE_FLOAT_VEC4>, dataTypeIsMatrixWithNRows<4> }, "mediump float compare_vec4 (mediump vec4 a, mediump vec4 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z)*compare_float(a.w, b.w); }" },
1259 { { dataTypeEquals<glu::TYPE_FLOAT_MAT2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat2 (mediump mat2 a, mediump mat2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1]); }" },
1260 { { dataTypeEquals<glu::TYPE_FLOAT_MAT2X3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat2x3 (mediump mat2x3 a, mediump mat2x3 b){ return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); }" },
1261 { { dataTypeEquals<glu::TYPE_FLOAT_MAT2X4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat2x4 (mediump mat2x4 a, mediump mat2x4 b){ return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1]); }" },
1262 { { dataTypeEquals<glu::TYPE_FLOAT_MAT3X2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat3x2 (mediump mat3x2 a, mediump mat3x2 b){ return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2]); }" },
1263 { { dataTypeEquals<glu::TYPE_FLOAT_MAT3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat3 (mediump mat3 a, mediump mat3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2]); }" },
1264 { { dataTypeEquals<glu::TYPE_FLOAT_MAT3X4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat3x4 (mediump mat3x4 a, mediump mat3x4 b){ return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2]); }" },
1265 { { dataTypeEquals<glu::TYPE_FLOAT_MAT4X2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat4x2 (mediump mat4x2 a, mediump mat4x2 b){ return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2])*compare_vec2(a[3], b[3]); }" },
1266 { { dataTypeEquals<glu::TYPE_FLOAT_MAT4X3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat4x3 (mediump mat4x3 a, mediump mat4x3 b){ return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2])*compare_vec3(a[3], b[3]); }" },
1267 { { dataTypeEquals<glu::TYPE_FLOAT_MAT4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_mat4 (mediump mat4 a, mediump mat4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2])*compare_vec4(a[3], b[3]); }" },
1268 { { dataTypeEquals<glu::TYPE_INT>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_int (mediump int a, mediump int b) { return a == b ? 1.0 : 0.0; }" },
1269 { { dataTypeEquals<glu::TYPE_INT_VEC2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_ivec2 (mediump ivec2 a, mediump ivec2 b) { return a == b ? 1.0 : 0.0; }" },
1270 { { dataTypeEquals<glu::TYPE_INT_VEC3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_ivec3 (mediump ivec3 a, mediump ivec3 b) { return a == b ? 1.0 : 0.0; }" },
1271 { { dataTypeEquals<glu::TYPE_INT_VEC4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_ivec4 (mediump ivec4 a, mediump ivec4 b) { return a == b ? 1.0 : 0.0; }" },
1272 { { dataTypeEquals<glu::TYPE_UINT>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_uint (mediump uint a, mediump uint b) { return a == b ? 1.0 : 0.0; }" },
1273 { { dataTypeEquals<glu::TYPE_UINT_VEC2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_uvec2 (mediump uvec2 a, mediump uvec2 b) { return a == b ? 1.0 : 0.0; }" },
1274 { { dataTypeEquals<glu::TYPE_UINT_VEC3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_uvec3 (mediump uvec3 a, mediump uvec3 b) { return a == b ? 1.0 : 0.0; }" },
1275 { { dataTypeEquals<glu::TYPE_UINT_VEC4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_uvec4 (mediump uvec4 a, mediump uvec4 b) { return a == b ? 1.0 : 0.0; }" },
1276 { { dataTypeEquals<glu::TYPE_BOOL>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_bool (bool a, bool b) { return a == b ? 1.0 : 0.0; }" },
1277 { { dataTypeEquals<glu::TYPE_BOOL_VEC2>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_bvec2 (bvec2 a, bvec2 b) { return a == b ? 1.0 : 0.0; }" },
1278 { { dataTypeEquals<glu::TYPE_BOOL_VEC3>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_bvec3 (bvec3 a, bvec3 b) { return a == b ? 1.0 : 0.0; }" },
1279 { { dataTypeEquals<glu::TYPE_BOOL_VEC4>, dataTypeEquals<glu::TYPE_INVALID> }, "mediump float compare_bvec4 (bvec4 a, bvec4 b) { return a == b ? 1.0 : 0.0; }" }
1282 const vector<glu::DataType> samplerTypes = m_uniformCollection->getSamplerTypes();
1291 if (glu::isDataTypeSampler(samplerTypes[i]))
1293 const glu::DataType retType = getSamplerLookupReturnType(samplerTypes[i]);
1310 if (glu::isDataTypeSampler(uniform.type))
1311 dst << "compare_" << glu::getDataTypeName(getSamplerLookupReturnType(uniform.type)) << "(texture(" << uniform.name << ", vec" << getSamplerNumLookupDimensions(uniform.type) << "(0.0))";
1313 dst << "compare_" << glu::getDataTypeName(uniform.type) << "(" << uniform.name;
1396 DE_ASSERT(getSamplerLookupReturnType(value.type) == glu::TYPE_FLOAT_VEC4);
1402 if (value.type == glu::TYPE_SAMPLER_2D)
1404 glu::Texture2D* texture = new glu::Texture2D(m_context.getRenderContext(), GL_RGBA, GL_UNSIGNED_BYTE, width, height);
1419 else if (value.type == glu::TYPE_SAMPLER_CUBE)
1423 glu::TextureCube* texture = new glu::TextureCube(m_context.getRenderContext(), GL_RGBA, GL_UNSIGNED_BYTE, width);
1470 const glu::DataType reportedType = glu::getDataTypeFromGLType(reportedTypeGL);
1473 TCU_CHECK_MSG(reportedType != glu::TYPE_LAST, "Invalid uniform type");
1475 log << TestLog::Message << "// Got name = " << reportedNameStr << ", name length = " << reportedNameLength << ", size = " << reportedSize << ", type = " << glu::getDataTypeName(reportedType) << TestLog::EndMessage;
1501 DE_ASSERT(reference.type != glu::TYPE_LAST);
1515 log << TestLog::Message << "// FAILURE: wrong type reported, should be " << glu::getDataTypeName(reference.type) << TestLog::EndMessage;
1599 const glu::DataType reportedType = glu::getDataTypeFromGLType((deUint32)uniformTypeBuf[validNdx]);
1601 TCU_CHECK_MSG(reportedType != glu::TYPE_LAST, "Invalid uniform type");
1606 << ", type = " << glu::getDataTypeName(reportedType)
1610 DE_ASSERT(reference.type != glu::TYPE_LAST);
1623 log << TestLog::Message << "// FAILURE: wrong type reported, should be " << glu::getDataTypeName(reference.type) << TestLog::EndMessage;
1714 const int size = glu::getDataTypeScalarSize(uniform.type);
1721 value.type = glu::TYPE_INVALID;
1737 if (glu::isDataTypeFloatOrVec(uniform.type) || glu::isDataTypeMatrix(uniform.type))
1739 else if (glu::isDataTypeIntOrIVec(uniform.type))
1741 else if (glu::isDataTypeUintOrUVec(uniform.type))
1743 else if (glu::isDataTypeBoolOrBVec(uniform.type))
1764 else if (glu::isDataTypeSampler(uniform.type))
1792 const int valSize = glu::getDataTypeScalarSize(uniform.type);
1796 if (unifValue.type == glu::TYPE_INVALID) // This happens when glGetUniformLocation() returned -1.
1812 if (glu::isDataTypeFloatOrVec(uniform.type) || glu::isDataTypeMatrix(uniform.type))
1814 else if (glu::isDataTypeIntOrIVec(uniform.type))
1816 else if (glu::isDataTypeUintOrUVec(uniform.type))
1818 else if (glu::isDataTypeBoolOrBVec(uniform.type))
1820 else if (glu::isDataTypeSampler(uniform.type))
1842 const glu::DataType boolApiType = m_features & FEATURE_BOOLEANAPITYPE_INT ? glu::TYPE_INT
1843 : m_features & FEATURE_BOOLEANAPITYPE_UINT ? glu::TYPE_UINT
1844 : glu::TYPE_FLOAT;
1866 const int typeSize = glu::getDataTypeScalarSize(uniform.type);
1867 const bool assignByValue = m_features & FEATURE_UNIFORMFUNC_VALUE && !glu::isDataTypeMatrix(uniform.type) && numValuesToAssign == 1;
1885 const VarValue apiValue = glu::isDataTypeBoolOrBVec(unifValue.type) ? getRandomBoolRepresentation(unifValue, boolApiType, rnd)
1886 : glu::isDataTypeSampler(unifValue.type) ? getSamplerUnitValue(unifValue)
1889 valuesToAssign.push_back(glu::isDataTypeMatrix(apiValue.type) && transpose ? getTransposeMatrix(apiValue) : apiValue);
1891 if (glu::isDataTypeBoolOrBVec(uniform.type))
1892 log << TestLog::Message << "// Using type " << glu::getDataTypeName(boolApiType) << " to set boolean value " << apiVarValueStr(unifValue) << " for " << curName << TestLog::EndMessage;
1893 else if (glu::isDataTypeSampler(uniform.type))
1899 if (glu::isDataTypeFloatOrVec(valuesToAssign[0].type))
1933 else if (glu::isDataTypeMatrix(valuesToAssign[0].type))
1944 case glu::TYPE_FLOAT_MAT2: GLU_CHECK_CALL(glUniformMatrix2fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1945 case glu::TYPE_FLOAT_MAT3: GLU_CHECK_CALL(glUniformMatrix3fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1946 case glu::TYPE_FLOAT_MAT4: GLU_CHECK_CALL(glUniformMatrix4fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1947 case glu::TYPE_FLOAT_MAT2X3: GLU_CHECK_CALL(glUniformMatrix2x3fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1948 case glu::TYPE_FLOAT_MAT2X4: GLU_CHECK_CALL(glUniformMatrix2x4fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1949 case glu::TYPE_FLOAT_MAT3X2: GLU_CHECK_CALL(glUniformMatrix3x2fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1950 case glu::TYPE_FLOAT_MAT3X4: GLU_CHECK_CALL(glUniformMatrix3x4fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1951 case glu::TYPE_FLOAT_MAT4X2: GLU_CHECK_CALL(glUniformMatrix4x2fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1952 case glu::TYPE_FLOAT_MAT4X3: GLU_CHECK_CALL(glUniformMatrix4x3fv (location, (GLsizei)valuesToAssign.size(), transposeGL, &buffer[0])); break;
1957 else if (glu::isDataTypeIntOrIVec(valuesToAssign[0].type))
1991 else if (glu::isDataTypeUintOrUVec(valuesToAssign[0].type))
2025 else if (glu::isDataTypeSampler(valuesToAssign[0].type))
2052 if (unifValue.type == glu::TYPE_INVALID) // This happens when glGetUniformLocation() returned -1.
2078 if (glu::isDataTypeSampler(basicUniforms[i].type))
2082 if (glu::isDataTypeSampler(basicUniforms[j].type) && basicUniforms[i].type != basicUniforms[j].type)
2090 if (glu::isDataTypeSampler(basicUniforms[i].type) && std::find(m_filledTextureUnits.begin(), m_filledTextureUnits.end(), basicUniforms[i].finalValue.val.samplerV.unit) == m_filledTextureUnits.end())
2115 glu::readPixels(m_context.getRenderContext(), viewportX, viewportY, renderedImg.getAccess());
2155 const ShaderProgram program (m_context.getRenderContext(), glu::makeVtxFragSources(vertexSource, fragmentSource));
2631 const glu::DataType dataType = s_testDataTypes[dataTypeNdx];
2632 const char* const typeName = glu::getDataTypeName(dataType);
2636 if (glu::isDataTypeScalar(dataType) ||
2637 (glu::isDataTypeVector(dataType) && glu::getDataTypeScalarSize(dataType) == 4) ||
2638 dataType == glu::TYPE_FLOAT_MAT4 ||
2639 dataType == glu::TYPE_SAMPLER_2D)
2642 if (glu::isDataTypeScalar(dataType) ||
2643 dataType == glu::TYPE_FLOAT_MAT4 ||
2644 dataType == glu::TYPE_SAMPLER_2D)
2646 const glu::DataType secondDataType = glu::isDataTypeScalar(dataType) ? glu::getDataTypeVector(dataType, 4)
2647 : dataType == glu::TYPE_FLOAT_MAT4 ? glu::TYPE_FLOAT_MAT2
2648 : dataType == glu::TYPE_SAMPLER_2D ? glu::TYPE_SAMPLER_CUBE
2649 : glu::TYPE_LAST;
2650 DE_ASSERT(secondDataType != glu::TYPE_LAST);
2651 const char* const secondTypeName = glu::getDataTypeName(secondDataType);
2758 const bool containsBooleans = uniformCollection->containsMatchingBasicType(glu::isDataTypeBoolOrBVec);
2823 const bool containsBooleans = uniformCollection->containsMatchingBasicType(glu::isDataTypeBoolOrBVec);
2827 const bool containsMatrices = uniformCollection->containsMatchingBasicType(glu::isDataTypeMatrix);