Home | History | Annotate | Download | only in functional

Lines Matching full:uniform

21  * \brief Uniform API tests.
326 struct Uniform
331 Uniform (const char* const name_, const glu::VarType& type_) : name(name_), type(type_) {}
340 Uniform& getUniform (const int ndx) { return m_uniforms[ndx]; }
341 const Uniform& getUniform (const int ndx) const { return m_uniforms[ndx]; }
343 void addUniform (const Uniform& uniform) { m_uniforms.push_back(uniform); }
399 res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(type, prec)));
407 res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(glu::VarType(type, prec), 3)));
427 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType)));
463 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType)));
526 Uniform uniform(("u_var" + de::toString(i)).c_str(), glu::VarType());
534 uniform.type = (("u_var" + de::toString(i)).c_str(), generateRandomType(3, structIdx, structTypes, rnd));
535 } while (res->getNumSamplers() + getNumSamplersInType(uniform.type) > MAX_NUM_SAMPLER_UNIFORMS);
537 res->addUniform(uniform);
552 vector<Uniform> m_uniforms;
917 // UNIFORMFUNC_VALUE: use pass-by-value versions of uniform assignment funcs, e.g. glUniform1f(), where possible. If not given, use pass-by-pointer versions.
934 // UNIFORMVALUE_ZERO: use zero-valued uniforms. If not given, use random uniform values.
951 // A basic uniform is a uniform (possibly struct or array member) whose type is a basic type (e.g. float, ivec4, sampler2d).
957 VarValue finalValue; //!< The value we ultimately want to set for this uniform.
1037 // Get uniform
1039 // Check that every uniform has the default (zero) value.
1043 // Compare the uniform values given in values (obtained with glGetUniform*()) with the basicUniform.finalValue values.
1045 // Render and check that all pixels are white (i.e. all uniform comparisons passed).
1056 // Generates the basic uniforms, based on the uniform with name varName and type varType, in the same manner as are expected
1067 void writeUniformCompareExpr (std::ostringstream& dst, const BasicUniform& uniform) const;
1244 dst << "uniform " << glu::declare(m_uniformCollection->getUniform(i).type, m_uniformCollection->getUniform(i).name.c_str()) << ";\n";
1308 void UniformCase::writeUniformCompareExpr (std::ostringstream& dst, const BasicUniform& uniform) const
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;
1315 dst << ", " << shaderVarValueStr(uniform.finalValue) << ")";
1459 log << TestLog::Message << "// Maximum uniform name length reported: " << uniformMaxNameLength << TestLog::EndMessage;
1473 TCU_CHECK_MSG(reportedType != glu::TYPE_LAST, "Invalid uniform type");
1494 log << TestLog::Message << "// FAILURE: invalid non-built-in uniform name reported" << TestLog::EndMessage;
1507 log << TestLog::Message << "// FAILURE: same uniform name reported twice" << TestLog::EndMessage;
1536 log << TestLog::Message << "// FAILURE: uniform with name " << expected.name << " was not reported by GL" << TestLog::EndMessage;
1570 log << TestLog::Message << "// FAILURE: uniform with name " << basicUniformReportsRef[i].name << " received GL_INVALID_INDEX" << TestLog::EndMessage;
1601 TCU_CHECK_MSG(reportedType != glu::TYPE_LAST, "Invalid uniform type");
1607 << " for the uniform at index " << reportedIndex << " (" << reference.name << ")"
1658 log << TestLog::Message << "// Checking uniform " << uniformName << TestLog::EndMessage;
1662 log << TestLog::Message << "// FAILURE: glGetActiveUniform() and glGetUniformIndices() gave different indices for uniform " << uniformName << TestLog::EndMessage;
1667 log << TestLog::Message << "// FAILURE: glGetActiveUniform() and glGetActiveUniformsiv() gave incompatible name lengths for uniform " << uniformName << TestLog::EndMessage;
1672 log << TestLog::Message << "// FAILURE: glGetActiveUniform() and glGetActiveUniformsiv() gave different sizes for uniform " << uniformName << TestLog::EndMessage;
1677 log << TestLog::Message << "// FAILURE: glGetActiveUniform() and glGetActiveUniformsiv() gave different types for uniform " << uniformName << TestLog::EndMessage;
1683 log << TestLog::Message << "// FAILURE: uniform " << uniformName << " was reported active by glGetActiveUniform() but not by glGetUniformIndices()" << TestLog::EndMessage;
1696 log << TestLog::Message << "// FAILURE: uniform " << uniformsivName << " was reported active by glGetUniformIndices() but not by glGetActiveUniform()" << TestLog::EndMessage;
1711 const BasicUniform& uniform = basicUniforms[unifNdx];
1712 const string queryName = m_features & FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? beforeLast(uniform.name, '[') : uniform.name;
1714 const int size = glu::getDataTypeScalarSize(uniform.type);
1723 if (uniform.isUsedInShader)
1725 log << TestLog::Message << "// FAILURE: " << uniform.name << " was used in shader, but has location -1" << TestLog::EndMessage;
1731 value.type = uniform.type;
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))
1775 log << TestLog::Message << "// Got " << uniform.name << " value " << apiVarValueStr(value) << TestLog::EndMessage;
1790 const BasicUniform& uniform = basicUniforms[unifNdx];
1792 const int valSize = glu::getDataTypeScalarSize(uniform.type);
1794 log << TestLog::Message << "// Checking uniform " << uniform.name << TestLog::EndMessage;
1806 log << TestLog::Message << "// FAILURE: uniform " << uniform.name << " has non-zero initial value" << TestLog::EndMessage; \
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))
1824 log << TestLog::Message << "// FAILURE: uniform " << uniform.name << " has non-zero initial value" << TestLog::EndMessage;
1848 const BasicUniform& uniform = basicUniforms[unifNdx];
1849 const bool isArrayMember = uniform.elemNdx >= 0;
1850 const string queryName = m_features & FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? beforeLast(uniform.name, '[') : uniform.name;
1852 : m_features & FEATURE_ARRAYASSIGN_FULL ? (uniform.elemNdx == 0 ? uniform.rootSize : 0)
1853 : m_features & FEATURE_ARRAYASSIGN_BLOCKS_OF_TWO ? (uniform.elemNdx % 2 == 0 ? 2 : 0)
1861 log << TestLog::Message << "// Uniform " << uniform.name << " is covered by another glUniform*v() call to the same array" << TestLog::EndMessage;
1866 const int typeSize = glu::getDataTypeScalarSize(uniform.type);
1867 const bool assignByValue = m_features & FEATURE_UNIFORMFUNC_VALUE && !glu::isDataTypeMatrix(uniform.type) && numValuesToAssign == 1;
1872 const string curName = isArrayMember ? beforeLast(uniform.rootName, '[') + "[" + de::toString(uniform.elemNdx+i) + "]" : uniform.name;
1883 unifValue = uniform.finalValue;
1891 if (glu::isDataTypeBoolOrBVec(uniform.type))
1893 else if (glu::isDataTypeSampler(uniform.type))
1894 log << TestLog::Message << "// Texture for the sampler uniform " << curName << " will be filled with color " << apiVarValueStr(getSamplerFillValue(uniform.finalValue)) << TestLog::EndMessage;
1942 switch (uniform.type)
2028 GLU_CHECK_CALL(glUniform1i(location, uniform.finalValue.val.samplerV.unit));
2031 const GLint unit = uniform.finalValue.val.samplerV.unit;
2047 const BasicUniform& uniform = basicUniforms[unifNdx];
2050 log << TestLog::Message << "// Checking uniform " << uniform.name << TestLog::EndMessage;
2055 if (!apiVarValueEquals(unifValue, uniform.finalValue))
2057 log << TestLog::Message << "// FAILURE: value obtained with glGetUniform*() for uniform " << uniform.name << " differs from value set with glUniform*()" << TestLog::EndMessage;
2243 const ScopedLogSection section(log, "InfoGetActiveUniform", "Uniform information queries with glGetActiveUniform()");
2264 const ScopedLogSection section(log, "InfoGetActiveUniformsiv", "Uniform information queries with glGetUniformIndices() and glGetActiveUniformsiv()");
2359 case VALUETOCHECK_INITIAL: return "Check initial uniform values (zeros)";
2360 case VALUETOCHECK_ASSIGNED: return "Check assigned uniform values";
2431 const ScopedLogSection section(log, "UniformAssign", "Uniform value assignments");
2442 const ScopedLogSection section(log, "GetUniforms", "Uniform value query");
2528 PERFORM_AND_CHECK(getActiveUniforms(reportsUniform, basicUniformReportsRef, programGL), "InfoGetActiveUniform", "Uniform information queries with glGetActiveUniform()");
2530 PERFORM_AND_CHECK(getActiveUniformsiv(reportsUniformsiv, basicUniformReportsRef, programGL), "InfoGetActiveUniformsiv", "Uniform information queries with glGetIndices() and glGetActiveUniformsiv()");
2539 PERFORM_AND_CHECK(getUniforms(uniformDefaultValues, basicUniforms, programGL), "GetUniformDefaults", "Uniform default value query");
2549 const ScopedLogSection section(log, "UniformAssign", "Uniform value assignments");
2554 PERFORM_AND_CHECK(getUniforms(uniformValues, basicUniforms, programGL), "GetUniforms", "Uniform value query");
2568 : TestCaseGroup(context, "uniform_api", "Uniform API Tests")
2667 TestCaseGroup* const infoQueryGroup = new TestCaseGroup(m_context, "info_query", "Test uniform info querying functions");
2727 // Cases testing uniform values.
2730 TestCaseGroup* const valueGroup = new TestCaseGroup(m_context, "value", "Uniform value tests");
2788 // Cases that first assign values to each uniform, then check the values with glGetUniform*() or by rendering.