<div dir="ltr"><div>Hi Daniel,</div><div><br></div>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.<div><br></div><div>The following is probably more relevant for Robert:</div><div><br></div><div>This also seems to be the cause of an issue OpenMW's been tracking for a while: <a href="https://gitlab.com/OpenMW/openmw/issues/4773">https://gitlab.com/OpenMW/openmw/issues/4773</a>. 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.</div><div><br></div><div>Cheers,</div><div><br></div><div>Chris</div><div><br>On Wednesday, 25 March 2020 09:17:16 UTC, OpenSceneGraph Users wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi Robert,
<br>
<br>> From your description it does sounds like reusing of the texture
<br>> objects should be forbidden.
<br>
<br>I think it might be fine to reuse the texture objects, because
<br>'Texture::<wbr>generateAndAssignTextureObject<wbr>' takes all the parameters
<br>needed by 'glTexStorage2D', so the returned texture object should
<br>already have the right storage. What currently is missing, is a flag on
<br>the texture object, if 'glTexStorage2D' has already been called for it.
<br>
<br>> Could you create an example that reproduces the issue? We can then
<br>> use these as testbed for any fixes we come up with.
<br>
<br>I don't quite know how I should trigger this case in an example. I've
<br>suspected that if a Texture2D gets deleted, then somehow its texture
<br>object gets added to 'TextureObjectSet::_<wbr>orphanedTextureObjects'. But
<br>I can't find this in the code. I'm only seeing additions to
<br>'_orphanedTextureObjects' in 'TextureObjectSet::<wbr>deleteAllTextureObjects'
<br>and 'TextureObjectSet::<wbr>handlePendingOrphandedTextureO<wbr>bjects'.
<br>
<br>Greetings,
<br>Daniel
<br>______________________________<wbr>_________________
<br>osg-users mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="bz-K_cV8EQAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">osg-...@lists.<wbr>openscenegraph.org</a>
<br><a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Flists.openscenegraph.org%2Flistinfo.cgi%2Fosg-users-openscenegraph.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEhxcobqaKtkSCnaCeBWJ1fFl93mw';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Flists.openscenegraph.org%2Flistinfo.cgi%2Fosg-users-openscenegraph.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEhxcobqaKtkSCnaCeBWJ1fFl93mw';return true;">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a>
<br></blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/132a649b-b316-43ce-afec-e2cd8da7db45%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/132a649b-b316-43ce-afec-e2cd8da7db45%40googlegroups.com</a>.<br />