Home | History | Annotate | Download | only in functional

Lines Matching refs:UniformInfo

68 struct UniformInfo
84 UniformInfo (VarType type_, ShaderStage declareLocation_, ShaderStage layoutLocation_, ShaderStage checkLocation_, int location_ = -1)
101 const vector<UniformInfo>& uniformInfo);
107 IterateResult run (const vector<UniformInfo>& uniformList);
108 static glu::ProgramSources genShaderSources (const vector<UniformInfo>& uniformList);
109 bool verifyLocations (const glu::ShaderProgram& program, const vector<UniformInfo>& uniformList);
110 void render (const glu::ShaderProgram& program, const vector<UniformInfo>& uniformList);
119 const vector<UniformInfo> m_uniformInfo;
150 const vector<UniformInfo>& uniformInfo)
153 , m_uniformInfo (uniformInfo)
221 UniformLocationCase::IterateResult UniformLocationCase::run (const vector<UniformInfo>& uniformList)
254 glu::ProgramSources UniformLocationCase::genShaderSources (const vector<UniformInfo>& uniformList)
283 const UniformInfo& uniformInfo = uniformList[uniformNdx];
285 const bool declareInVert = (uniformInfo.declareLocation & UniformInfo::SHADERSTAGE_VERTEX) != 0;
286 const bool declareInFrag = (uniformInfo.declareLocation & UniformInfo::SHADERSTAGE_FRAGMENT) != 0;
287 const bool layoutInVert = (uniformInfo.layoutLocation & UniformInfo::SHADERSTAGE_VERTEX) != 0;
288 const bool layoutInFrag = (uniformInfo.layoutLocation & UniformInfo::SHADERSTAGE_FRAGMENT) != 0;
289 const bool checkInVert = (uniformInfo.checkLocation & UniformInfo::SHADERSTAGE_VERTEX) != 0;
290 const bool checkInFrag = (uniformInfo.checkLocation & UniformInfo::SHADERSTAGE_FRAGMENT) != 0;
292 const string layout = uniformInfo.location >= 0 ? "layout(location = " + de::toString(uniformInfo.location) + ") " : "";
295 int location = uniformInfo.location;
303 if (uniformInfo.type.isStructType())
305 const glu::StructType* const structType = uniformInfo.type.getStructPtr();
319 vertDecl << "uniform " << (layoutInVert ? layout : "") << glu::declare(uniformInfo.type, uniName) << ";\n";
322 fragDecl << "uniform " << (layoutInFrag ? layout : "") << glu::declare(uniformInfo.type, uniName) << ";\n";
325 for (glu::BasicTypeIterator subTypeIter = glu::BasicTypeIterator::begin(&uniformInfo.type); subTypeIter != glu::BasicTypeIterator::end(&uniformInfo.type); subTypeIter++, subTypeIndex++)
327 const glu::VarType subType = glu::getVarType(uniformInfo.type, subTypeIter.getPath());
336 << glu::TypeAccessFormat(uniformInfo.type, subTypeIter.getPath())
340 << glu::TypeAccessFormat(uniformInfo.type, subTypeIter.getPath())
347 << glu::TypeAccessFormat(uniformInfo.type, subTypeIter.getPath())
351 << glu::TypeAccessFormat(uniformInfo.type, subTypeIter.getPath())
363 bool UniformLocationCase::verifyLocations (const glu::ShaderProgram& program, const vector<UniformInfo>& uniformList)
387 const UniformInfo& uniformInfo = uniformList[uniformNdx];
390 for (glu::BasicTypeIterator subTypeIter = glu::BasicTypeIterator::begin(&uniformInfo.type); subTypeIter != glu::BasicTypeIterator::end(&uniformInfo.type); subTypeIter++, subTypeIndex++)
392 const string name = getUniformName(uniformNdx, uniformInfo.type, subTypeIter.getPath());
394 const int expectLoc = uniformInfo.location >= 0 ? uniformInfo.location+subTypeIndex : -1;
398 if (uniformInfo.checkLocation == 0 && gotLoc == -1)
521 void UniformLocationCase::render (const glu::ShaderProgram& program, const vector<UniformInfo>& uniformList)
557 const UniformInfo& uniformInfo = uniformList[uniformNdx];
558 int expectedLocation = uniformInfo.location;
560 for (glu::BasicTypeIterator subTypeIter = glu::BasicTypeIterator::begin(&uniformInfo.type); subTypeIter != glu::BasicTypeIterator::end(&uniformInfo.type); subTypeIter++)
562 const glu::VarType type = glu::getVarType(uniformInfo.type, subTypeIter.getPath());
563 const string name = getUniformName(uniformNdx, uniformInfo.type, subTypeIter.getPath());
652 const vector<UniformInfo>& uniformInfo);
661 const vector<UniformInfo>& uniformInfo)
662 : UniformLocationCase(context, renderContext, name, desc, uniformInfo)
664 DE_ASSERT(!uniformInfo.empty());
670 vector<UniformInfo> uniformInfo = m_uniformInfo;
674 uniformInfo[0].location = maxLocation-1;
676 return UniformLocationCase::run(uniformInfo);
701 const UniformInfo::ShaderStage checkStages[] = { UniformInfo::SHADERSTAGE_VERTEX, UniformInfo::SHADERSTAGE_FRAGMENT };
760 vector<UniformInfo> config;
762 UniformInfo uniform (createVarType(type),
789 vector<UniformInfo> config;
791 UniformInfo uniform (VarType(createVarType(type), 8),
819 vector<UniformInfo> config;
821 UniformInfo uniform (VarType(VarType(createVarType(type), arraySize), arraySize),
841 typedef UniformInfo::ShaderStage Stage;
861 vector<UniformInfo> config;
863 config.push_back(UniformInfo(VarType(structProto),
882 typedef UniformInfo::ShaderStage Stage;
953 vector<UniformInfo> config;
955 config.push_back(UniformInfo(VarType(testTypes[0]),
961 config.push_back(UniformInfo(VarType(testTypes[1]),
967 config.push_back(UniformInfo(VarType(testTypes[2]),
973 config.push_back(UniformInfo(VarType(testTypes[3]),
997 vector<UniformInfo> config;
999 config.push_back(UniformInfo(createVarType(type),
1022 vector<UniformInfo> config;
1028 typedef UniformInfo::ShaderStage Stage;
1034 const UniformInfo uniform (createVarType(primitiveTypes[rng.getInt(0, maxPrimitiveTypeNdx)]),