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

Robert Osfield robert.osfield at gmail.com
Fri Jul 26 10:18:42 PDT 2019

Hi Chris,

On Fri, 26 Jul 2019 at 17:46, Chris Djali <krizdjali at gmail.com> wrote:

> This does solve the problem. Is it definitely safe it do this, though?
> What if the camera references stuff still shared by another context (e.g.
> RTT cameras that get added to and removed from an existing context)? I
> don't imagine you want to add a regression while fixing this.

O bugger, good point, yep lucky it didn't make it into 3.6.4 :-)

This issue is like juggling with a dozen different ball, with each ball
being a different usage case!

You can always subclass from Camera and override the destruct if you want
to add this "fix" if it suits your usage case.

The approach I have taken with the VSG is for the GPU objects to hold a
ref_ptr<> to the VkInstance wrapper preventing it being deleted when the
objects are still in use.  It's thread safe, robust for a lots of different
usage cases and straight forward.  Alas OpenGL can't be managed like this,
or at least I don't think you can keep a graphics context around after a
window has been deleted.  If I was to writing an OpenGL scene graph from
scratch I'd probably try to resolve this topic in a more flexible way than
the OSG which has evolve from narrower usage cases to more and more general
usage cases as users have pushed and pulled it in various directions.

For now I'll need to focus on getting my BOF presentation written rather
than bug fixing, it's end of the working here in Scotland so I'm in weekend
mode too and not about to try to think too hard about anything other than
chilling wit my family.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190726/b098e012/attachment.html>

More information about the osg-users mailing list