Home | History | Annotate | Download | only in functional

Lines Matching full:uniform

23  * \todo [2013-02-26 nuutti] Much duplication between ES2&3 uniform api
306 struct Uniform
311 Uniform (const char* const name_, const glu::VarType& type_) : name(name_), type(type_) {}
320 Uniform& getUniform (const int ndx) { return m_uniforms[ndx]; }
321 const Uniform& getUniform (const int ndx) const { return m_uniforms[ndx]; }
323 void addUniform (const Uniform& uniform) { m_uniforms.push_back(uniform); }
379 res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(type, prec)));
387 res->m_uniforms.push_back(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(glu::VarType(type, prec), 3)));
407 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType)));
443 res->addUniform(Uniform((string("u_var") + nameSuffix).c_str(), glu::VarType(structType)));
503 vector<Uniform> m_uniforms;
811 // UNIFORMFUNC_VALUE: use pass-by-value versions of uniform assignment funcs, e.g. glProgramUniform1f(), where possible. If not given, use pass-by-pointer versions.
841 // A basic uniform is a uniform (possibly struct or array member) whose type is a basic type (e.g. float, ivec4, sampler2d).
847 VarValue finalValue; //!< The value we ultimately want to set for this uniform.
897 // Get uniform values with glGetUniform*() and put to valuesDst. Uniforms that get -1 from glGetUniformLocation() get glu::TYPE_INVALID.
901 // Compare the uniform values given in values (obtained with glGetUniform*()) with the basicUniform.finalValue values.
903 // Render and check that all pixels are green (i.e. all uniform comparisons passed).
912 // Generates the basic uniforms, based on the uniform with name varName and type varType, in the same manner as are expected
923 void writeUniformCompareExpr (std::ostringstream& dst, const BasicUniform& uniform) const;
1060 dst << "uniform " << glu::declare(m_uniformCollection->getUniform(i).type, m_uniformCollection->getUniform(i).name.c_str()) << ";\n";
1124 void UniformCase::writeUniformCompareExpr (std::ostringstream& dst, const BasicUniform& uniform) const
1126 if (glu::isDataTypeSampler(uniform.type))
1127 dst << "compare_" << glu::getDataTypeName(getSamplerLookupReturnType(uniform.type)) << "(texture(" << uniform.name << ", vec" << getSamplerNumLookupDimensions(uniform.type) << "(0.0))";
1129 dst << "compare_" << glu::getDataTypeName(uniform.type) << "(" << uniform.name;
1131 dst << ", " << shaderVarValueStr(uniform.finalValue) << ")";
1270 const BasicUniform& uniform = basicUniforms[unifNdx];
1271 const string queryName = m_features & FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? beforeLast(uniform.name, '[') : uniform.name;
1273 const int size = glu::getDataTypeScalarSize(uniform.type);
1282 if (uniform.isUsedInShader)
1284 log << TestLog::Message << "// FAILURE: " << uniform.name << " was used in shader, but has location -1" << TestLog::EndMessage;
1290 value.type = uniform.type;
1296 if (glu::isDataTypeFloatOrVec(uniform.type) || glu::isDataTypeMatrix(uniform.type))
1298 else if (glu::isDataTypeIntOrIVec(uniform.type))
1300 else if (glu::isDataTypeUintOrUVec(uniform.type))
1302 else if (glu::isDataTypeBoolOrBVec(uniform.type))
1323 else if (glu::isDataTypeSampler(uniform.type))
1334 log << TestLog::Message << "// Got " << uniform.name << " value " << apiVarValueStr(value) << TestLog::EndMessage;
1351 const BasicUniform& uniform = basicUniforms[unifNdx];
1352 const bool isArrayMember = uniform.elemNdx >= 0;
1353 const string queryName = m_features & FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? beforeLast(uniform.name, '[') : uniform.name;
1355 : m_features & FEATURE_ARRAYASSIGN_FULL ? (uniform.elemNdx == 0 ? uniform.rootSize : 0)
1356 : m_features & FEATURE_ARRAYASSIGN_BLOCKS_OF_TWO ? (uniform.elemNdx % 2 == 0 ? 2 : 0)
1364 log << TestLog::Message << "// Uniform " << uniform.name << " is covered by another glProgramUniform*v() call to the same array" << TestLog::EndMessage;
1369 const int typeSize = glu::getDataTypeScalarSize(uniform.type);
1370 const bool assignByValue = m_features & FEATURE_UNIFORMFUNC_VALUE && !glu::isDataTypeMatrix(uniform.type) && numValuesToAssign == 1;
1375 const string curName = isArrayMember ? beforeLast(uniform.rootName, '[') + "[" + de::toString(uniform.elemNdx+i) + "]" : uniform.name;
1386 unifValue = uniform.finalValue;
1394 if (glu::isDataTypeBoolOrBVec(uniform.type))
1396 else if (glu::isDataTypeSampler(uniform.type))
1397 log << TestLog::Message << "// Texture for the sampler uniform " << curName << " will be filled with color " << apiVarValueStr(getSamplerFillValue(uniform.finalValue)) << TestLog::EndMessage;
1445 switch (uniform.type)
1531 GLU_CHECK_CALL(glProgramUniform1i(programGL, location, uniform.finalValue.val.samplerV.unit));
1534 const GLint unit = uniform.finalValue.val.samplerV.unit;
1550 const BasicUniform& uniform = basicUniforms[unifNdx];
1553 log << TestLog::Message << "// Checking uniform " << uniform.name << TestLog::EndMessage;
1558 if (!apiVarValueEquals(unifValue, uniform.finalValue))
1560 log << TestLog::Message << "// FAILURE: value obtained with glGetUniform*() for uniform " << uniform.name << " differs from value set with glProgramUniform*()" << TestLog::EndMessage;
1797 const ScopedLogSection section(log, "UniformAssign", "Uniform value assignments");
1806 const ScopedLogSection section(log, "GetUniforms", "Uniform value query");
1932 // Basic by-pointer or by-value uniform assignment cases.