Home | History | Annotate | Download | only in functional

Lines Matching full:uniform

21  * \brief Uniform API tests.
260 struct Uniform
265 Uniform (const char* const name_, const glu::VarType& type_) : name(name_), type(type_) {}
274 Uniform& getUniform (const int ndx) { return m_uniforms[ndx]; }
275 const Uniform& getUniform (const int ndx) const { return m_uniforms[ndx]; }
277 void addUniform (const Uniform& uniform) { m_uniforms.push_back(uniform); }
333 res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(type, prec)));
341 res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(glu::VarType(type, prec), 3)));
361 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType)));
397 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType)));
460 Uniform uniform(("u_var" + de::toString(i)).c_str(), glu::VarType());
468 uniform.type = (("u_var" + de::toString(i)).c_str(), generateRandomType(3, structIdx, structTypes, rnd));
469 } while (res->getNumSamplers() + getNumSamplersInType(uniform.type) > MAX_NUM_SAMPLER_UNIFORMS);
471 res->addUniform(uniform);
486 vector<Uniform> m_uniforms;
756 // UNIFORMFUNC_VALUE: use pass-by-value versions of uniform assignment funcs, e.g. glUniform1f(), where possible. If not given, use pass-by-pointer versions.
769 // UNIFORMVALUE_ZERO: use zero-valued uniforms. If not given, use random uniform values.
786 // A basic uniform is a uniform (possibly struct or array member) whose type is a basic type (e.g. float, ivec4, sampler2d).
792 VarValue finalValue; //!< The value we ultimately want to set for this uniform.
868 // Get uniform values with glGetUniform*() and put to valuesDst. Uniforms that get -1 from glGetUniformLocation() get glu::TYPE_INVALID.
870 // Check that every uniform has the default (zero) value.
874 // Compare the uniform values given in values (obtained with glGetUniform*()) with the basicUniform.finalValue values.
876 // Render and check that all pixels are white (i.e. all uniform comparisons passed).
887 // Generates the basic uniforms, based on the uniform with name varName and type varType, in the same manner as are expected
898 void writeUniformCompareExpr (std::ostringstream& dst, const BasicUniform& uniform) const;
1073 dst << "uniform " << glu::declare(m_uniformCollection->getUniform(i).type, m_uniformCollection->getUniform(i).name.c_str()) << ";\n";
1114 void UniformCase::writeUniformCompareExpr (std::ostringstream& dst, const BasicUniform& uniform) const
1116 if (glu::isDataTypeSampler(uniform.type))
1119 << (uniform.type == glu::TYPE_SAMPLER_2D ? "texture2D" : "textureCube")
1120 << "(" << uniform.name << ", vec" << getSamplerNumLookupDimensions(uniform.type) << "(0.0))";
1123 dst << "compare_" << glu::getDataTypeName(uniform.type) << "(" << uniform.name;
1125 dst << ", " << shaderVarValueStr(uniform.finalValue) << ")";
1262 log << TestLog::Message << "// Maximum uniform name length reported: " << uniformMaxNameLength << TestLog::EndMessage;
1276 TCU_CHECK_MSG(reportedType != glu::TYPE_LAST, "Invalid uniform type");
1297 log << TestLog::Message << "// FAILURE: invalid non-built-in uniform name reported" << TestLog::EndMessage;
1310 log << TestLog::Message << "// FAILURE: same uniform name reported twice" << TestLog::EndMessage;
1339 log << TestLog::Message << "// FAILURE: uniform with name " << expected.name << " was not reported by GL" << TestLog::EndMessage;
1354 const BasicUniform& uniform = basicUniforms[unifNdx];
1355 const string queryName = m_features & FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? beforeLast(uniform.name, '[') : uniform.name;
1357 const int size = glu::getDataTypeScalarSize(uniform.type);
1366 if (uniform.isUsedInShader)
1368 log << TestLog::Message << "// FAILURE: " << uniform.name << " was used in shader, but has location -1" << TestLog::EndMessage;
1374 value.type = uniform.type;
1379 if (glu::isDataTypeFloatOrVec(uniform.type) || glu::isDataTypeMatrix(uniform.type))
1381 else if (glu::isDataTypeIntOrIVec(uniform.type))
1383 else if (glu::isDataTypeBoolOrBVec(uniform.type))
1398 else if (glu::isDataTypeSampler(uniform.type))
1409 log << TestLog::Message << "// Got " << uniform.name << " value " << apiVarValueStr(value) << TestLog::EndMessage;
1424 const BasicUniform& uniform = basicUniforms[unifNdx];
1426 const int valSize = glu::getDataTypeScalarSize(uniform.type);
1428 log << TestLog::Message << "// Checking uniform " << uniform.name << TestLog::EndMessage;
1440 log << TestLog::Message << "// FAILURE: uniform " << uniform.name << " has non-zero initial value" << TestLog::EndMessage; \
1446 if (glu::isDataTypeFloatOrVec(uniform.type) || glu::isDataTypeMatrix(uniform.type))
1448 else if (glu::isDataTypeIntOrIVec(uniform.type))
1450 else if (glu::isDataTypeBoolOrBVec(uniform.type))
1452 else if (glu::isDataTypeSampler(uniform.type))
1456 log << TestLog::Message << "// FAILURE: uniform " << uniform.name << " has non-zero initial value" << TestLog::EndMessage;
1477 const BasicUniform& uniform = basicUniforms[unifNdx];
1478 const bool isArrayMember = uniform.elemNdx >= 0;
1479 const string queryName = m_features & FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? beforeLast(uniform.name, '[') : uniform.name;
1481 : m_features & FEATURE_ARRAYASSIGN_FULL ? (uniform.elemNdx == 0 ? uniform.rootSize : 0)
1482 : m_features & FEATURE_ARRAYASSIGN_BLOCKS_OF_TWO ? (uniform.elemNdx % 2 == 0 ? 2 : 0)
1490 log << TestLog::Message << "// Uniform " << uniform.name << " is covered by another glUniform*v() call to the same array" << TestLog::EndMessage;
1495 const int typeSize = glu::getDataTypeScalarSize(uniform.type);
1496 const bool assignByValue = m_features & FEATURE_UNIFORMFUNC_VALUE && !glu::isDataTypeMatrix(uniform.type) && numValuesToAssign == 1;
1501 const string curName = isArrayMember ? beforeLast(uniform.rootName, '[') + "[" + de::toString(uniform.elemNdx+i) + "]" : uniform.name;
1512 unifValue = uniform.finalValue;
1520 if (glu::isDataTypeBoolOrBVec(uniform.type))
1522 else if (glu::isDataTypeSampler(uniform.type))
1523 log << TestLog::Message << "// Texture for the sampler uniform " << curName << " will be filled with color " << apiVarValueStr(getSamplerFillValue(uniform.finalValue)) << TestLog::EndMessage;
1570 switch (uniform.type)
1616 GLU_CHECK_CALL(glUniform1i(location, uniform.finalValue.val.samplerV.unit));
1619 const GLint unit = uniform.finalValue.val.samplerV.unit;
1635 const BasicUniform& uniform = basicUniforms[unifNdx];
1638 log << TestLog::Message << "// Checking uniform " << uniform.name << TestLog::EndMessage;
1643 if (!apiVarValueEquals(unifValue, uniform.finalValue))
1645 log << TestLog::Message << "// FAILURE: value obtained with glGetUniform*() for uniform " << uniform.name << " differs from value set with glUniform*()" << TestLog::EndMessage;
1785 const ScopedLogSection section(log, "InfoGetActiveUniform", "Uniform information queries with glGetActiveUniform()");
1857 case VALUETOCHECK_INITIAL: return "Check initial uniform values (zeros)";
1858 case VALUETOCHECK_ASSIGNED: return "Check assigned uniform values";
1929 const ScopedLogSection section(log, "UniformAssign", "Uniform value assignments");
1940 const ScopedLogSection section(log, "GetUniforms", "Uniform value query");
2021 PERFORM_AND_CHECK(getActiveUniforms(reportsUniform, basicUniformReportsRef, programGL), "InfoGetActiveUniform", "Uniform information queries with glGetActiveUniform()");
2028 PERFORM_AND_CHECK(getUniforms(uniformDefaultValues, basicUniforms, programGL), "GetUniformDefaults", "Uniform default value query");
2038 const ScopedLogSection section(log, "UniformAssign", "Uniform value assignments");
2043 PERFORM_AND_CHECK(getUniforms(uniformValues, basicUniforms, programGL), "GetUniforms", "Uniform value query");
2057 : TestCaseGroup(context, "uniform_api", "Uniform API Tests")
2203 // Cases testing uniform values.
2206 TestCaseGroup* const valueGroup = new TestCaseGroup(m_context, "value", "Uniform value tests");
2262 // Cases that first assign values to each uniform, then check the values with glGetUniform*() or by rendering.