Hi Daniel,

It should be as simple as setting up a texture, using it to draw something, 
and then setting up a different texture to use instead. As long as the 
first one goes out of scope properly, it should end up in the orphaned 
pool, and then will eventually get reused. You might have to replace the 
texture multiple times before new ones get taken from the pool, though.

The following is probably more relevant for Robert:

This also seems to be the cause of an issue OpenMW's been tracking for a 
while: https://gitlab.com/OpenMW/openmw/issues/4773. We have stack traces 
and APITrace traces there if that helps. We'd got as far as identifying the 
commit responsible, but hadn't made the link between recycling things from 
the orphaned pool and immutable storage (although I know I'd looked at the 
orphaned pool already, so I guess it was before I'd done anything with 
immutable storage or I'd have made the connection). I've brought it up here 
in the past, but Robert didn't want to open an issue upstream until we were 
sure OpenMW wasn't doing anything dumb. I'm glad someone else has appeared 
who's done the hard part of tracking the problem down.

Cheers,

Chris

On Wednesday, 25 March 2020 09:17:16 UTC, OpenSceneGraph Users wrote:
>
> Hi Robert, 
>
> > From your description it does sounds like reusing of the texture 
> > objects should be forbidden. 
>
> I think it might be fine to reuse the texture objects, because 
> 'Texture::generateAndAssignTextureObject' takes all the parameters 
> needed by 'glTexStorage2D', so the returned texture object should 
> already have the right storage. What currently is missing, is a flag on 
> the texture object, if 'glTexStorage2D' has already been called for it. 
>
> > Could you create an example that reproduces the issue? We can then 
> > use these as testbed for any fixes we come up with. 
>
> I don't quite know how I should trigger this case in an example. I've 
> suspected that if a Texture2D gets deleted, then somehow its texture 
> object gets added to 'TextureObjectSet::_orphanedTextureObjects'. But 
> I can't find this in the code. I'm only seeing additions to 
> '_orphanedTextureObjects' in 'TextureObjectSet::deleteAllTextureObjects' 
> and 'TextureObjectSet::handlePendingOrphandedTextureObjects'. 
>
> Greetings, 
> Daniel 
> _______________________________________________ 
> osg-users mailing list 
> osg-...@lists.openscenegraph.org <javascript:> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/132a649b-b316-43ce-afec-e2cd8da7db45%40googlegroups.com.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to