Fixed handling of osg::Program so that it's not overriden by shader composition when enabled

This commit is contained in:
Robert Osfield 2013-10-22 11:18:28 +00:00
parent 4493d11ca3
commit 5ed399ca48

View File

@ -535,13 +535,19 @@ void State::apply(const StateSet* dstate)
else if (unit<_textureAttributeMapList.size()) applyAttributeMapOnTexUnit(unit,_textureAttributeMapList[unit]);
}
const Program::PerContextProgram* previousLastAppliedProgramObject = _lastAppliedProgramObject;
applyModeList(_modeMap,dstate->getModeList());
applyAttributeList(_attributeMap,dstate->getAttributeList());
if (_shaderCompositionEnabled)
{
if (previousLastAppliedProgramObject == _lastAppliedProgramObject || _lastAppliedProgramObject==0)
{
// No program has been applied by the StateSet stack so assume shader composition is required
applyShaderComposition();
}
}
if (dstate->getUniformList().empty())
{