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

Chris Djali krizdjali at gmail.com
Tue Aug 20 05:43:41 PDT 2019


Here it is again:


AnyOldName3 wrote:
> Hi,
> 
> Hopefully, after that two-week hiatus, we can get this sorted.
> 
> 
> > You can always subclass from Camera and override the destruct if you want to add this "fix" if it suits your usage case. 
> 
> 
> I'm already going to have to include a separate fix for older OSG versions (and I have a good idea of how I'll implement it), as we're supposed to support as far back as 3.4.x, so if we're abandoning the idea of actually fixing the issue in OSG itself, I've already got a workaround figured out.
> 
> I imagine, though, that until everyone who writes applications knows how to use Vulkan and all devices have Vulkan support, removing the footgun from OSG is still your preferred option.
> 
> 
> > 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. 
> 
> 
> That does sound like a much nicer way of doing things. The only thing similar I can think of with OpenGL is to have a sharing context with access to the same objects as the main window, and to only destroy this extra context once everything has been released, but then I'm still discovering surprising new OpenGL features that can do new things.
> 
> Cheers,
> Chris


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76598#76598







More information about the osg-users mailing list