2.8 branch: Uniform lookup by cached name ID. Trunk revisions r11952, r11998, and r12074.

This commit is contained in:
Paul MARTZ
2011-05-02 22:13:01 +00:00
parent 288fb20eb6
commit 2f7167d011
5 changed files with 65 additions and 12 deletions

View File

@@ -394,7 +394,7 @@ bool Program::getGlProgramInfoLog(unsigned int contextID, std::string& log) cons
return getPCP( contextID )->getInfoLog( log );
}
const Program::ActiveVarInfoMap& Program::getActiveUniforms(unsigned int contextID) const
const Program::ActiveUniformMap& Program::getActiveUniforms(unsigned int contextID) const
{
return getPCP( contextID )->getActiveUniforms();
}
@@ -532,10 +532,9 @@ void Program::PerContextProgram::linkProgram()
if( loc != -1 )
{
_uniformInfoMap[name] = ActiveVarInfo(loc,type,size);
_uniformInfoMap[Uniform::getNameID(reinterpret_cast<const char*>(name))] = ActiveVarInfo(loc,type,size);
osg::notify(osg::INFO)
<< "\tUniform \"" << name << "\""
OSG_INFO << "\tUniform \"" << name << "\""
<< " loc="<< loc
<< " size="<< size
<< " type=" << Uniform::getTypename((Uniform::Type)type)