Hi Robert and all,

Another question related to multi-screen/multi-context applications (yes,
still one...). I am currently trying to save some memory on my application,
so I want some of my textures to be uploaded in the graphic card and release
it from the classic RAM, that's why I set setUnRefImageDataAfterApply to
true.

But looking at Texture2D.cpp, here is the conditions to unref an image :

state.getMaxTexturePoolSize()==0 &&
_unrefImageDataAfterApply &&
areAllTextureObjectsLoaded() &&
image->getDataVariance()==STATIC

I am currently having troubles with the areAllTextureObjectsLoaded
condition, it checks if all the available contexts have uploaded the
texture. The problem here is that my texture is designed only for one of my
screens, so it's applied for only one context, so this condition is always
false and the image is never released.

Am I doing something wrong ? And is there any way to force my image to be
unref ? The only solution is a custom callback setting the image to NULL
after a first apply ?

Thanks !

-- 
Serge Lages
http://www.tharsis-software.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to