Thanks. The problem is in GLExtensions.cpp. It has some maps that it keeps, and it adds contexts and does not take them off. But GraphicsContext will provide an old, no-long-used context ID, and that ID can look up the wrong thing in GLExtensions.cpp if we have changed from hardware to software OpenGL.
Oh, wait. I see, you're talking about when the GLExtensions object gets created. Let me look into that. We make lots of windows over time, and don't really know in advance how many we'll have, either at one time or across a session. We are drawing into buffers that then get drawn into Java windows. andy -----Original Message----- From: osg-users <[email protected]> On Behalf Of Robert Osfield Sent: Wednesday, September 19, 2018 4:20 AM To: OpenSceneGraph Users <[email protected]> Subject: Re: [osg-users] context IDs Hi Andy, It's quite a while since I worked specifically on the osg::State, ContextID, osg::GLExtensions management. In principle it should be possible to reuse ContextID's, the sticky issue of whether the GLExtensions object is recreated for each new graphics context is something I haven't personally tested. Looking at osg::State is does look to clean up the GLExtensions object in 3.4 onwards (I haven't checked further back) For graphics performance I would recommend that applications don't go creating and destroying GraphicsWindows, if possible just hide the window and reuse it will provide better performance. Cheers, Robert. On Mon, 17 Sep 2018 at 19:08, Andy Skinner <[email protected]> wrote: > > If we get our contextIDs from GraphicsContext::createNewContextID(), it could > give us a new number or return a previous one, if we are returning them with > GraphicsContext::decrementContextIDUsageCount. Right? > > > > Is there an intended connection between a contextID that has been used and a > new one? It looks to me that extensions are stored per context ID and never > reset. > > > > So if we change something about what we are looking for in the context > (sometimes we fall back to software OpenGL for testing or helping a customer > through an issue), we might reuse a context ID, but still have extensions > associated with the ID that are not appropriate for it. > > > > Am I missing an assumption here? Should I be able to reuse a contextID for > an unrelated context? If not, I'll just remove call to > decrementContextIDUsageCount. That means the number and various maps will > continue to grow. > > > > thanks > > andy > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org. > openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

