Closed calumr closed 5 months ago
Can you please provide some evidence of this? Or a reproduction case?
The osg::Program
object tracks its own per-context state in its internal osg::Program::PerContextProgram
(PCP) construct. So when VirtualProgram pulls an existing program from the repo, it always checks the currently active PCP and compiles it on demand as necessary.
If you use osgEarth in more than one context in a single process, a VirtualProgram that is identical in both contexts will not be compiled on the second context to use it. This eventually causes a crash when trying to link an uncompiled program.
Registry::programRepo uses a key for each program that is a hash of the source, but it should probably include the context id too.