Lines Matching defs: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 glu::VarType type = glu::getVarType(uniformInfo.type, subTypeIter.getPath());
393 const string name = getUniformName(uniformNdx, uniformInfo.type, subTypeIter.getPath());
395 const int expectLoc = uniformInfo.location >= 0 ? uniformInfo.location+subTypeIndex : -1;
399 if (uniformInfo.checkLocation == 0 && gotLoc == -1)
522 void UniformLocationCase::render (const glu::ShaderProgram& program, const vector<UniformInfo>& uniformList)
558 const UniformInfo& uniformInfo = uniformList[uniformNdx];
559 int expectedLocation = uniformInfo.location;
561 for (glu::BasicTypeIterator subTypeIter = glu::BasicTypeIterator::begin(&uniformInfo.type); subTypeIter != glu::BasicTypeIterator::end(&uniformInfo.type); subTypeIter++)
563 const glu::VarType type = glu::getVarType(uniformInfo.type, subTypeIter.getPath());
564 const string name = getUniformName(uniformNdx, uniformInfo.type, subTypeIter.getPath());
653 const vector<UniformInfo>& uniformInfo);
662 const vector<UniformInfo>& uniformInfo)
663 : UniformLocationCase(context, renderContext, name, desc, uniformInfo)
665 DE_ASSERT(!uniformInfo.empty());
671 vector<UniformInfo> uniformInfo = m_uniformInfo;
675 uniformInfo[0].location = maxLocation-1;
677 return UniformLocationCase::run(uniformInfo);
702 const UniformInfo::ShaderStage checkStages[] = { UniformInfo::SHADERSTAGE_VERTEX, UniformInfo::SHADERSTAGE_FRAGMENT };
761 vector<UniformInfo> config;
763 UniformInfo uniform (createVarType(type),
790 vector<UniformInfo> config;
792 UniformInfo uniform (VarType(createVarType(type), 8),
820 vector<UniformInfo> config;
822 UniformInfo uniform (VarType(VarType(createVarType(type), arraySize), arraySize),
842 typedef UniformInfo::ShaderStage Stage;
862 vector<UniformInfo> config;
864 config.push_back(UniformInfo(VarType(structProto),
883 typedef UniformInfo::ShaderStage Stage;
954 vector<UniformInfo> config;
956 config.push_back(UniformInfo
962 config.push_back(UniformInfo(VarType(testTypes[1]),
968 config.push_back(UniformInfo(VarType(testTypes[2]),
974 config.push_back(UniformInfo(VarType(testTypes[3]),
999 vector<UniformInfo> config;
1001 config.push_back(UniformInfo(createVarType(type),
1024 vector<UniformInfo> config;
1030 typedef UniformInfo::ShaderStage Stage;
1036 const UniformInfo uniform (createVarType(primitiveTypes[rng.getInt(0, maxPrimitiveTypeNdx)]),