In Program::PerContextProgram changed const Uniform* to osg::ref_ptr<const Uniform*> to avoid the possibility of a uniform being deleted
and another being created and assigned at the same address which previously confused the uniform tracking code and introduced a bug.
This commit is contained in:
parent
174f9bbfe0
commit
061be3d084
@ -188,7 +188,7 @@ class OSG_EXPORT Program : public osg::StateAttribute
|
||||
if (location>=0)
|
||||
{
|
||||
if ((unsigned int)location>=_lastAppliedUniformList.size()) _lastAppliedUniformList.resize(location+1);
|
||||
const Uniform* lastAppliedUniform = _lastAppliedUniformList[location].first;
|
||||
const Uniform* lastAppliedUniform = _lastAppliedUniformList[location].first.get();
|
||||
if (lastAppliedUniform != &uniform)
|
||||
{
|
||||
// new attribute
|
||||
@ -241,7 +241,7 @@ class OSG_EXPORT Program : public osg::StateAttribute
|
||||
ActiveVarInfoMap _uniformInfoMap;
|
||||
ActiveVarInfoMap _attribInfoMap;
|
||||
|
||||
typedef std::pair<const osg::Uniform*, unsigned int> UniformModifiedCountPair;
|
||||
typedef std::pair<osg::ref_ptr<const osg::Uniform>, unsigned int> UniformModifiedCountPair;
|
||||
typedef std::vector<UniformModifiedCountPair> LastAppliedUniformList;
|
||||
mutable LastAppliedUniformList _lastAppliedUniformList;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user