From 0415b7df8419c55a18e2850ad82b8dbc387e1f24 Mon Sep 17 00:00:00 2001 From: valid-ptr Date: Wed, 28 Oct 2020 15:13:19 +0300 Subject: [PATCH] ShaderComposition mechanism on the osg::State fixed: condition improved --- src/osg/State.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osg/State.cpp b/src/osg/State.cpp index ab253a76a..7765f59ca 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -715,7 +715,7 @@ void State::apply(const StateSet* dstate) // Checking if there is no program on the stack or the program is not applied from the AttributeStack (StateSet core mechanism) if (_shaderCompositionEnabled && (_lastAppliedProgramObject == 0 || - (_lastAppliedProgramObject->getProgram() != _attributeMap[_lastAppliedProgramObject->getProgram()->getTypeMemberPair()].last_applied_attribute))) + (_lastAppliedProgramObject->getProgram() != getLastAppliedAttribute(osg::StateAttribute::PROGRAM)))) { // No program has been applied by the StateSet stack so assume shader composition is required applyShaderComposition(); @@ -786,7 +786,7 @@ void State::apply() // Checking if there is no program on the stack or the program is not applied from the AttributeStack (StateSet core mechanism) if (_shaderCompositionEnabled && (_lastAppliedProgramObject == 0 || - (_lastAppliedProgramObject->getProgram() != _attributeMap[_lastAppliedProgramObject->getProgram()->getTypeMemberPair()].last_applied_attribute))) + (_lastAppliedProgramObject->getProgram() != getLastAppliedAttribute(osg::StateAttribute::PROGRAM)))) { // No program has been applied by the StateSet stack so assume shader composition is required applyShaderComposition();