[osg-users] Removing objects with shared GL state from scene graph

Robert Osfield robert.osfield at gmail.com
Sun Jun 30 06:18:29 PDT 2019


Hi Chris,

On Sun, 30 Jun 2019 at 00:52, Chris Djali <krizdjali at gmail.com> wrote:

> The high-level behaviour is all fine as-is. The specific problem is that
> it's not safe to call osgText::Text::releaseGLObjects when removing a text
> object as that releases GL objects for the font, too, and that can still be
> in use by other text nodes.
>

It should be safe to call Text/Font::releaseGLObjects(state) with the
deletion of GraphicsContext that the state associated with that
GraphiscContext, that's the intention, if that isn't working and the high
level functionality is working correctly then this is a bug.

I've just done a quick review of the code and master and 3.6 branch do
mostly seem to be doing what they should in the
Text/Font::releaseGLObjects().  There is one area that does look like it
might be missing some releaseGLObjects() calls is in the handling of
Glyph3D objects.

However, in your example where you were playing games with globals to
prevent destruction, this remains the wrong way to implement viewers and is
not supported by the relaseGLObjects() scheme, for reasons I've outlined in
my replies above.

Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190630/20239e4d/attachment.html>


More information about the osg-users mailing list