osg/Program
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
* Copyright (C) 2003-2005 3Dlabs Inc. Ltd.
* Copyright (C) 2004-2005 Nathan Cournia
* Copyright (C) 2008 Zebra Imaging
* Copyright (C) 2010 Vires Simulationstechnologie GmbH
*
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial
* applications, as long as this copyright notice is maintained.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/* file: include/osg/Program
* author: Mike Weiblen 2008-01-02
* Holger Helmich 2010-10-21
*/
#ifndef OSG_PROGRAM
#define OSG_PROGRAM 1
#include <string>
#include <vector>
#include <map>
#include <osg/buffered_value>
#include <osg/ref_ptr>
#include <osg/Uniform>
#include <osg/Shader>
#include <osg/StateAttribute>
namespace osg {
class State;
class OSG_EXPORT Program : public osg::StateAttribute
{
public:
Program();
Program(const Program& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_StateAttribute(osg, Program, PROGRAM);
virtual int compare(const osg::StateAttribute& sa) const;
virtual void apply(osg::State& state) const;
virtual void setThreadSafeRefUnref(bool threadSafe);
virtual void compileGLObjects(osg::State& state) const;
virtual void resizeGLObjectBuffers(unsigned int maxSize);
virtual void releaseGLObjects(osg::State* state=0) const;
void dirtyProgram();
bool addShader( Shader* shader );
template<class T> bool addShader( const ref_ptr<T>& shader ) { return addShader(shader.get()); }
unsigned int getNumShaders() const { return static_cast<unsigned int>(_shaderList.size()); }
Shader* getShader( unsigned int i ) { return _shaderList[i].get(); }
const Shader* getShader( unsigned int i ) const { return _shaderList[i].get(); }
bool removeShader( Shader* shader );
template<class T> bool removeShader( const ref_ptr<T>& shader ) { return removeShader(shader.get()); }
void setParameter( GLenum pname, GLint value );
GLint getParameter( GLenum pname ) const;
void addBindAttribLocation( const std::string& name, GLuint index );
void removeBindAttribLocation( const std::string& name );
void addBindFragDataLocation( const std::string& name, GLuint index );
void removeBindFragDataLocation( const std::string& name );
void addBindUniformBlock(const std::string& name, GLuint index);
void removeBindUniformBlock(const std::string& name);
void removeTransformFeedBackVarying(const std::string& name)
{
for(std::vector<std::string>::iterator i=_feedbackout.begin(); i!=_feedbackout.end(); i++)
{
if (*i == name) {_feedbackout.erase(i);break; }
}
}
void addTransformFeedBackVarying(const std::string& outname)
{
_feedbackout.push_back(outname);
}
inline unsigned int getNumTransformFeedBackVaryings() const { return _feedbackout.size(); }
inline const std::string& getTransformFeedBackVarying(unsigned int i) const { return _feedbackout[i]; }
void setTransformFeedBackMode(GLenum e) {_feedbackmode=e;}
GLenum getTransformFeedBackMode() const {return _feedbackmode;}
void setShaderDefines(const ShaderDefines& shaderDefs) { _shaderDefines = shaderDefs; }
ShaderDefines& getShaderDefines() { return _shaderDefines; }
const ShaderDefines& getShaderDefines() const { return _shaderDefines; }
class OSG_EXPORT ProgramBinary : public osg::Object
{
public:
ProgramBinary();
ProgramBinary(const ProgramBinary& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osg, ProgramBinary);
void allocate(unsigned int size);
void assign(unsigned int size, const unsigned char* data);
void setFormat(GLenum format) {_format = format;}
GLenum getFormat() const {return _format;}
unsigned int getSize() const { return static_cast<unsigned int>(_data.size()); }
unsigned char* getData() { return _data.empty() ? 0 : &(_data.front()); }
const unsigned char* getData() const { return _data.empty() ? 0 : &(_data.front()); }
protected:
std::vector<unsigned char> _data;
GLenum _format;
};
void setProgramBinary(ProgramBinary* programBinary) { _programBinary = programBinary; }
ProgramBinary* getProgramBinary() { return _programBinary.get(); }
const ProgramBinary* getProgramBinary() const { return _programBinary.get(); }
typedef std::map<std::string,GLuint> AttribBindingList;
typedef std::map<std::string,GLuint> FragDataBindingList;
typedef std::map<std::string,GLuint> UniformBlockBindingList;
const AttribBindingList& getAttribBindingList() const { return _attribBindingList; }
const FragDataBindingList& getFragDataBindingList() const { return _fragDataBindingList; }
const UniformBlockBindingList& getUniformBlockBindingList() const { return _uniformBlockBindingList; }
bool isFixedFunction() const;
bool getGlProgramInfoLog(unsigned int contextID, std::string& log) const;
struct ActiveVarInfo {
ActiveVarInfo() : _location(-1), _type(Uniform::UNDEFINED), _size(-1) {}
ActiveVarInfo( GLint loc, GLenum type, GLint size ) : _location(loc), _type(type), _size(size) {}
GLint _location;
GLenum _type;
GLint _size;
};
typedef std::map< unsigned int, ActiveVarInfo > ActiveUniformMap;
typedef std::map< std::string, ActiveVarInfo > ActiveVarInfoMap;
//const ActiveUniformMap& getActiveUniforms(unsigned int contextID) const;
//const ActiveVarInfoMap& getActiveAttribs(unsigned int contextID) const;
struct UniformBlockInfo
{
UniformBlockInfo() : _index(GL_INVALID_INDEX), _size(0) {}
UniformBlockInfo(GLuint index, GLsizei size)
: _index(index), _size(size)
{
}
GLuint _index;
GLsizei _size;
};
typedef std::map<std::string, UniformBlockInfo> UniformBlockMap;
//const UniformBlockMap& getUniformBlocks(unsigned contextID) const;
public:
// make PerContextProgram a friend to allow it access Program's protected
// methods and member variables.
class PerContextProgram;
friend class PerContextProgram;
class OSG_EXPORT PerContextProgram : public osg::Referenced
{
public:
PerContextProgram(const Program* program, unsigned int contextID, GLuint programHandle=0);
GLuint getHandle() const {return _glProgramHandle;}
const osg::Program* getProgram() const { return _program; }
void setDefineString(const std::string& defStr) { _defineStr = defStr; }
const std::string& getDefineString() const { return _defineStr; }
void requestLink();
virtual void linkProgram(osg::State& state);
virtual bool validateProgram();
bool needsLink() const {return _needsLink;}
bool isLinked() const {return _isLinked;}
virtual bool getInfoLog( std::string& infoLog ) const;
bool loadedBinary() const {return _loadedBinary;}
virtual ProgramBinary* compileProgramBinary(osg::State& state);
virtual void useProgram() const;
void resetAppliedUniforms() const
{
_lastAppliedUniformList.clear();
}
inline void apply(const Uniform& uniform) const
{
GLint location = getUniformLocation(uniform.getNameID());
if (location>=0)
{
const Uniform* lastAppliedUniform = _lastAppliedUniformList[location].first.get();
if (lastAppliedUniform != &uniform)
{
// new attribute
uniform.apply(_extensions.get(),location);
_lastAppliedUniformList[location].first = &uniform;
_lastAppliedUniformList[location].second = uniform.getModifiedCount();
}
else if (_lastAppliedUniformList[location].second != uniform.getModifiedCount())
{
// existing attribute has been modified
uniform.apply(_extensions.get(),location);
_lastAppliedUniformList[location].first = &uniform;
_lastAppliedUniformList[location].second = uniform.getModifiedCount();
}
}
}
const ActiveUniformMap& getActiveUniforms() const {return _uniformInfoMap;}
const ActiveVarInfoMap& getActiveAttribs() const {return _attribInfoMap;}
const UniformBlockMap& getUniformBlocks() const {return _uniformBlockMap; }
inline GLint getUniformLocation( unsigned int uniformNameID ) const { ActiveUniformMap::const_iterator itr = _uniformInfoMap.find(uniformNameID); return (itr!=_uniformInfoMap.end()) ? itr->second._location : -1; }
inline GLint getUniformLocation( const std::string & uniformName ) const { return getUniformLocation( Uniform::getNameID( uniformName ) ); }
inline GLint getAttribLocation( const std::string& name ) const { ActiveVarInfoMap::const_iterator itr = _attribInfoMap.find(name); return (itr!=_attribInfoMap.end()) ? itr->second._location : -1; }
inline void addShaderToAttach(Shader *shader)
{
_shadersToAttach.push_back(shader);
}
inline void addShaderToDetach(Shader *shader)
{
_shadersToDetach.push_back(shader);
}
protected: /*methods*/
virtual ~PerContextProgram();
protected: /*data*/
const Program* _program;
osg::ref_ptr<GLExtensions> _extensions;
GLuint _glProgramHandle;
std::string _defineStr;
bool _needsLink;
bool _isLinked;
bool _loadedBinary;
const unsigned int _contextID;
bool _ownsProgramHandle;
ActiveUniformMap _uniformInfoMap;
ActiveVarInfoMap _attribInfoMap;
UniformBlockMap _uniformBlockMap;
typedef std::pair<osg::ref_ptr<const osg::Uniform>, unsigned int> UniformModifiedCountPair;
typedef std::map<unsigned int, UniformModifiedCountPair> LastAppliedUniformList;
mutable LastAppliedUniformList _lastAppliedUniformList;
typedef std::vector< ref_ptr<Shader> > ShaderList;
ShaderList _shadersToDetach;
ShaderList _shadersToAttach;
private:
PerContextProgram(); // disallowed
PerContextProgram(const PerContextProgram&); // disallowed
PerContextProgram& operator=(const PerContextProgram&); // disallowed
};
struct OSG_EXPORT ProgramObjects : public osg::GraphicsObject
{
typedef std::vector< osg::ref_ptr<PerContextProgram> > PerContextPrograms;
ProgramObjects(const Program* program, unsigned int contextID);
unsigned int _contextID;
const Program* _program;
mutable PerContextPrograms _perContextPrograms;
PerContextProgram* getPCP(const std::string& defineStr) const;
PerContextProgram* createPerContextProgram(const std::string& defineStr);
void requestLink();
void addShaderToAttach(Shader* shader);
void addShaderToDetach(Shader* shader);
bool getGlProgramInfoLog(std::string& log) const;
};
PerContextProgram* getPCP(State& state) const;
protected: /*methods*/
virtual ~Program();
protected: /*data*/
mutable osg::buffered_value< osg::ref_ptr<ProgramObjects> > _pcpList;
AttribBindingList _attribBindingList;
FragDataBindingList _fragDataBindingList;
UniformBlockBindingList _uniformBlockBindingList;
typedef std::vector< ref_ptr<Shader> > ShaderList;
ShaderList _shaderList;
osg::ref_ptr<ProgramBinary> _programBinary;
GLint _geometryVerticesOut;
GLint _geometryInputType;
GLint _geometryOutputType;
GLenum _feedbackmode;
std::vector<std::string> _feedbackout;
ShaderDefines _shaderDefines;
private:
Program& operator=(const Program&); // disallowed
};
}
#endif
GL_INVALID_INDEX
#define GL_INVALID_INDEX
Definition GLDefines:320
Shader
StateAttribute
Uniform
buffered_value
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::GraphicsObject
Definition GLObjects:47
osg::Object
Definition Object:61
osg::Program::PerContextProgram
Definition osg/Program:264
osg::Program::PerContextProgram::_needsLink
bool _needsLink
Definition osg/Program:368
osg::Program::PerContextProgram::PerContextProgram
PerContextProgram(const Program *program, unsigned int contextID, GLuint programHandle=0)
osg::Program::PerContextProgram::addShaderToDetach
void addShaderToDetach(Shader *shader)
Definition osg/Program:347
osg::Program::PerContextProgram::isLinked
bool isLinked() const
Definition osg/Program:280
osg::Program::PerContextProgram::_uniformBlockMap
UniformBlockMap _uniformBlockMap
Definition osg/Program:381
osg::Program::PerContextProgram::apply
void apply(const Uniform &uniform) const
Definition osg/Program:302
osg::Program::PerContextProgram::getDefineString
const std::string & getDefineString() const
Definition osg/Program:274
osg::Program::PerContextProgram::ShaderList
std::vector< ref_ptr< Shader > > ShaderList
Definition osg/Program:387
osg::Program::PerContextProgram::getInfoLog
virtual bool getInfoLog(std::string &infoLog) const
osg::Program::PerContextProgram::setDefineString
void setDefineString(const std::string &defStr)
Definition osg/Program:273
osg::Program::PerContextProgram::requestLink
void requestLink()
osg::Program::PerContextProgram::getAttribLocation
GLint getAttribLocation(const std::string &name) const
Definition osg/Program:340
osg::Program::PerContextProgram::_loadedBinary
bool _loadedBinary
Definition osg/Program:372
osg::Program::PerContextProgram::_defineStr
std::string _defineStr
Definition osg/Program:365
osg::Program::PerContextProgram::_lastAppliedUniformList
LastAppliedUniformList _lastAppliedUniformList
Definition osg/Program:385
osg::Program::PerContextProgram::LastAppliedUniformList
std::map< unsigned int, UniformModifiedCountPair > LastAppliedUniformList
Definition osg/Program:384
osg::Program::PerContextProgram::~PerContextProgram
virtual ~PerContextProgram()
osg::Program::PerContextProgram::useProgram
virtual void useProgram() const
osg::Program::PerContextProgram::resetAppliedUniforms
void resetAppliedUniforms() const
Definition osg/Program:296
osg::Program::PerContextProgram::compileProgramBinary
virtual ProgramBinary * compileProgramBinary(osg::State &state)
osg::Program::PerContextProgram::UniformModifiedCountPair
std::pair< osg::ref_ptr< const osg::Uniform >, unsigned int > UniformModifiedCountPair
Definition osg/Program:383
osg::Program::PerContextProgram::_extensions
osg::ref_ptr< GLExtensions > _extensions
Definition osg/Program:359
osg::Program::PerContextProgram::_isLinked
bool _isLinked
Definition osg/Program:370
osg::Program::PerContextProgram::_attribInfoMap
ActiveVarInfoMap _attribInfoMap
Definition osg/Program:380
osg::Program::PerContextProgram::getUniformLocation
GLint getUniformLocation(const std::string &uniformName) const
Definition osg/Program:338
osg::Program::PerContextProgram::_contextID
const unsigned int _contextID
Definition osg/Program:374
osg::Program::PerContextProgram::needsLink
bool needsLink() const
Definition osg/Program:279
osg::Program::PerContextProgram::_ownsProgramHandle
bool _ownsProgramHandle
Definition osg/Program:377
osg::Program::PerContextProgram::getUniformBlocks
const UniformBlockMap & getUniformBlocks() const
Definition osg/Program:327
osg::Program::PerContextProgram::_shadersToAttach
ShaderList _shadersToAttach
Definition osg/Program:389
osg::Program::PerContextProgram::getActiveUniforms
const ActiveUniformMap & getActiveUniforms() const
Definition osg/Program:325
osg::Program::PerContextProgram::validateProgram
virtual bool validateProgram()
osg::Program::PerContextProgram::getProgram
const osg::Program * getProgram() const
Definition osg/Program:271
osg::Program::PerContextProgram::_glProgramHandle
GLuint _glProgramHandle
Definition osg/Program:362
osg::Program::PerContextProgram::addShaderToAttach
void addShaderToAttach(Shader *shader)
Definition osg/Program:342
osg::Program::PerContextProgram::getUniformLocation
GLint getUniformLocation(unsigned int uniformNameID) const
Definition osg/Program:328
osg::Program::PerContextProgram::_uniformInfoMap
ActiveUniformMap _uniformInfoMap
Definition osg/Program:379
osg::Program::PerContextProgram::_program
const Program * _program
Definition osg/Program:357
osg::Program::PerContextProgram::_shadersToDetach
ShaderList _shadersToDetach
Definition osg/Program:388
osg::Program::PerContextProgram::loadedBinary
bool loadedBinary() const
Definition osg/Program:284
osg::Program::PerContextProgram::getActiveAttribs
const ActiveVarInfoMap & getActiveAttribs() const
Definition osg/Program:326
osg::Program::PerContextProgram::getHandle
GLuint getHandle() const
Definition osg/Program:269
osg::Program::PerContextProgram::linkProgram
virtual void linkProgram(osg::State &state)
osg::Program::ProgramBinary
Definition osg/Program:169
osg::Program::ProgramBinary::getData
unsigned char * getData()
Definition osg/Program:195
osg::Program::ProgramBinary::_format
GLenum _format
Definition osg/Program:202
osg::Program::ProgramBinary::getFormat
GLenum getFormat() const
Definition osg/Program:189
osg::Program::ProgramBinary::assign
void assign(unsigned int size, const unsigned char *data)
osg::Program::ProgramBinary::setFormat
void setFormat(GLenum format)
Definition osg/Program:186
osg::Program::ProgramBinary::ProgramBinary
ProgramBinary(const ProgramBinary &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osg::Program::ProgramBinary::getSize
unsigned int getSize() const
Definition osg/Program:192
osg::Program::ProgramBinary::allocate
void allocate(unsigned int size)
osg::Program::ProgramBinary::getData
const unsigned char * getData() const
Definition osg/Program:198
osg::Program::ProgramBinary::_data
std::vector< unsigned char > _data
Definition osg/Program:201
osg::Program::ProgramBinary::META_Object
META_Object(osg, ProgramBinary)
osg::Program::ProgramBinary::ProgramBinary
ProgramBinary()
osg::Program
Definition osg/Program:52
osg::Program::getNumShaders
unsigned int getNumShaders() const
Definition osg/Program:91
osg::Program::UniformBlockBindingList
std::map< std::string, GLuint > UniformBlockBindingList
Definition osg/Program:219
osg::Program::getShader
Shader * getShader(unsigned int i)
Definition osg/Program:93
osg::Program::apply
virtual void apply(osg::State &state) const
osg::Program::addTransformFeedBackVarying
void addTransformFeedBackVarying(const std::string &outname)
Definition osg/Program:137
osg::Program::getShaderDefines
ShaderDefines & getShaderDefines()
Definition osg/Program:156
osg::Program::_geometryOutputType
GLint _geometryOutputType
Definition osg/Program:436
osg::Program::_programBinary
osg::ref_ptr< ProgramBinary > _programBinary
Definition osg/Program:431
osg::Program::releaseGLObjects
virtual void releaseGLObjects(osg::State *state=0) const
osg::Program::FragDataBindingList
std::map< std::string, GLuint > FragDataBindingList
Definition osg/Program:218
osg::Program::addShader
bool addShader(const ref_ptr< T > &shader)
Definition osg/Program:89
osg::Program::AttribBindingList
std::map< std::string, GLuint > AttribBindingList
Definition osg/Program:217
osg::Program::getTransformFeedBackMode
GLenum getTransformFeedBackMode() const
Definition osg/Program:152
osg::Program::addBindFragDataLocation
void addBindFragDataLocation(const std::string &name, GLuint index)
osg::Program::_feedbackmode
GLenum _feedbackmode
Definition osg/Program:439
osg::Program::getShaderDefines
const ShaderDefines & getShaderDefines() const
Definition osg/Program:157
osg::Program::_uniformBlockBindingList
UniformBlockBindingList _uniformBlockBindingList
Definition osg/Program:426
osg::Program::compare
virtual int compare(const osg::StateAttribute &sa) const
osg::Program::_shaderList
ShaderList _shaderList
Definition osg/Program:429
osg::Program::ShaderList
std::vector< ref_ptr< Shader > > ShaderList
Definition osg/Program:428
osg::Program::isFixedFunction
bool isFixedFunction() const
osg::Program::setThreadSafeRefUnref
virtual void setThreadSafeRefUnref(bool threadSafe)
osg::Program::Program
Program(const Program &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osg::Program::getShader
const Shader * getShader(unsigned int i) const
Definition osg/Program:94
osg::Program::getTransformFeedBackVarying
const std::string & getTransformFeedBackVarying(unsigned int i) const
Definition osg/Program:146
osg::Program::removeBindAttribLocation
void removeBindAttribLocation(const std::string &name)
osg::Program::_attribBindingList
AttribBindingList _attribBindingList
Definition osg/Program:424
osg::Program::addShader
bool addShader(Shader *shader)
osg::Program::removeBindFragDataLocation
void removeBindFragDataLocation(const std::string &name)
osg::Program::Program
Program()
osg::Program::addBindUniformBlock
void addBindUniformBlock(const std::string &name, GLuint index)
osg::Program::_geometryInputType
GLint _geometryInputType
Definition osg/Program:435
osg::Program::_fragDataBindingList
FragDataBindingList _fragDataBindingList
Definition osg/Program:425
osg::Program::getNumTransformFeedBackVaryings
unsigned int getNumTransformFeedBackVaryings() const
Definition osg/Program:143
osg::Program::_feedbackout
std::vector< std::string > _feedbackout
Definition osg/Program:440
osg::Program::setTransformFeedBackMode
void setTransformFeedBackMode(GLenum e)
Definition osg/Program:149
osg::Program::getProgramBinary
ProgramBinary * getProgramBinary()
Definition osg/Program:212
osg::Program::removeBindUniformBlock
void removeBindUniformBlock(const std::string &name)
osg::Program::ActiveVarInfoMap
std::map< std::string, ActiveVarInfo > ActiveVarInfoMap
Definition osg/Program:239
osg::Program::removeShader
bool removeShader(Shader *shader)
osg::Program::removeTransformFeedBackVarying
void removeTransformFeedBackVarying(const std::string &name)
Definition osg/Program:128
osg::Program::~Program
virtual ~Program()
osg::Program::getPCP
PerContextProgram * getPCP(State &state) const
osg::Program::resizeGLObjectBuffers
virtual void resizeGLObjectBuffers(unsigned int maxSize)
osg::Program::setProgramBinary
void setProgramBinary(ProgramBinary *programBinary)
Definition osg/Program:209
osg::Program::getParameter
GLint getParameter(GLenum pname) const
osg::Program::getProgramBinary
const ProgramBinary * getProgramBinary() const
Definition osg/Program:215
osg::Program::getUniformBlockBindingList
const UniformBlockBindingList & getUniformBlockBindingList() const
Definition osg/Program:223
osg::Program::_pcpList
osg::buffered_value< osg::ref_ptr< ProgramObjects > > _pcpList
Definition osg/Program:423
osg::Program::removeShader
bool removeShader(const ref_ptr< T > &shader)
Definition osg/Program:100
osg::Program::setParameter
void setParameter(GLenum pname, GLint value)
osg::Program::addBindAttribLocation
void addBindAttribLocation(const std::string &name, GLuint index)
osg::Program::compileGLObjects
virtual void compileGLObjects(osg::State &state) const
osg::Program::_geometryVerticesOut
GLint _geometryVerticesOut
Definition osg/Program:434
osg::Program::META_StateAttribute
META_StateAttribute(osg, Program, PROGRAM)
osg::Program::ActiveUniformMap
std::map< unsigned int, ActiveVarInfo > ActiveUniformMap
Definition osg/Program:238
osg::Program::getAttribBindingList
const AttribBindingList & getAttribBindingList() const
Definition osg/Program:221
osg::Program::getFragDataBindingList
const FragDataBindingList & getFragDataBindingList() const
Definition osg/Program:222
osg::Program::setShaderDefines
void setShaderDefines(const ShaderDefines &shaderDefs)
Definition osg/Program:155
osg::Program::UniformBlockMap
std::map< std::string, UniformBlockInfo > UniformBlockMap
Definition osg/Program:252
osg::Program::dirtyProgram
void dirtyProgram()
osg::Program::getGlProgramInfoLog
bool getGlProgramInfoLog(unsigned int contextID, std::string &log) const
osg::Program::_shaderDefines
ShaderDefines _shaderDefines
Definition osg/Program:442
osg::Referenced
Definition Referenced:44
osg::Shader
Definition Shader:89
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::PROGRAM
@ PROGRAM
Definition StateAttribute:164
osg::State
Definition State:80
osg::Uniform
Definition Uniform:414
osg::Uniform::getNameID
static unsigned int getNameID(const std::string &name)
osg::Uniform::apply
void apply(const GLExtensions *ext, GLint location) const
osg::Uniform::getModifiedCount
unsigned int getModifiedCount() const
Definition Uniform:909
osg::buffered_value
Definition buffered_value:27
osg::ref_ptr
Definition ref_ptr:32
osg::ref_ptr::get
T * get() const
Definition ref_ptr:117
osg
Definition AlphaFunc:19
osg::ShaderDefines
std::set< std::string > ShaderDefines
Definition Shader:37
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39
ref_ptr
osg::Program::ActiveVarInfo::ActiveVarInfo
ActiveVarInfo(GLint loc, GLenum type, GLint size)
Definition osg/Program:233
osg::Program::ActiveVarInfo::_location
GLint _location
Definition osg/Program:234
osg::Program::ActiveVarInfo::ActiveVarInfo
ActiveVarInfo()
Definition osg/Program:232
osg::Program::ActiveVarInfo::_size
GLint _size
Definition osg/Program:236
osg::Program::ActiveVarInfo::_type
GLenum _type
Definition osg/Program:235
osg::Program::ProgramObjects::getPCP
PerContextProgram * getPCP(const std::string &defineStr) const
osg::Program::ProgramObjects::_perContextPrograms
PerContextPrograms _perContextPrograms
Definition osg/Program:405
osg::Program::ProgramObjects::PerContextPrograms
std::vector< osg::ref_ptr< PerContextProgram > > PerContextPrograms
Definition osg/Program:399
osg::Program::ProgramObjects::getGlProgramInfoLog
bool getGlProgramInfoLog(std::string &log) const
osg::Program::ProgramObjects::addShaderToAttach
void addShaderToAttach(Shader *shader)
osg::Program::ProgramObjects::_contextID
unsigned int _contextID
Definition osg/Program:403
osg::Program::ProgramObjects::ProgramObjects
ProgramObjects(const Program *program, unsigned int contextID)
osg::Program::ProgramObjects::requestLink
void requestLink()
osg::Program::ProgramObjects::addShaderToDetach
void addShaderToDetach(Shader *shader)
osg::Program::ProgramObjects::_program
const Program * _program
Definition osg/Program:404
osg::Program::ProgramObjects::createPerContextProgram
PerContextProgram * createPerContextProgram(const std::string &defineStr)
osg::Program::UniformBlockInfo::UniformBlockInfo
UniformBlockInfo(GLuint index, GLsizei size)
Definition osg/Program:245
osg::Program::UniformBlockInfo::UniformBlockInfo
UniformBlockInfo()
Definition osg/Program:244
osg::Program::UniformBlockInfo::_size
GLsizei _size
Definition osg/Program:250
osg::Program::UniformBlockInfo::_index
GLuint _index
Definition osg/Program:249