diff --git a/src/osgUtil/GLObjectsVisitor.cpp b/src/osgUtil/GLObjectsVisitor.cpp index a4f7ab4c0..820d1a6be 100644 --- a/src/osgUtil/GLObjectsVisitor.cpp +++ b/src/osgUtil/GLObjectsVisitor.cpp @@ -138,7 +138,7 @@ void GLObjectsVisitor::apply(osg::StateSet& stateset) if (_lastCompiledProgram.valid() && !stateset.getUniformList().empty()) { - osg::Program::PerContextProgram* pcp = _lastCompiledProgram->getPCP(_renderInfo.getState()->getContextID()); + osg::Program::PerContextProgram* pcp = _lastCompiledProgram->getPCP(*_renderInfo.getState()); if (pcp) { pcp->useProgram();