2.8 branch: Uniform lookup by cached name ID. Trunk revisions r11952, r11998, and r12074.
This commit is contained in:
@@ -975,7 +975,16 @@ class OSG_EXPORT State : public Referenced, public Observer
|
||||
}
|
||||
inline const Program::PerContextProgram* getLastAppliedProgramObject() const { return _lastAppliedProgramObject; }
|
||||
|
||||
inline GLint getUniformLocation( const std::string& name ) const { return _lastAppliedProgramObject ? _lastAppliedProgramObject->getUniformLocation(name) : -1; }
|
||||
inline GLint getUniformLocation( unsigned int uniformNameID ) const { return _lastAppliedProgramObject ? _lastAppliedProgramObject->getUniformLocation(uniformNameID) : -1; }
|
||||
/**
|
||||
* Alternative version of getUniformLocation( unsigned int uniformNameID )
|
||||
* retrofited into OSG for backward compatibility with osgCal,
|
||||
* after uniform ids were refactored from std::strings to GLints in OSG version 2.9.10.
|
||||
*
|
||||
* Drawbacks: This method is not particularly fast. It has to access mutexed static
|
||||
* map of uniform ids. So don't overuse it or your app performance will suffer.
|
||||
*/
|
||||
inline GLint getUniformLocation( const std::string & uniformName ) const { return _lastAppliedProgramObject ? _lastAppliedProgramObject->getUniformLocation(uniformName) : -1; }
|
||||
inline GLint getAttribLocation( const std::string& name ) const { return _lastAppliedProgramObject ? _lastAppliedProgramObject->getAttribLocation(name) : -1; }
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user