Hi Serge, Enable the unref image after apply in your case is a bit awkward as, as you have found, the mechanism assumes that all contexts will require the texture.
Another way around the issue is to use the texture object pool to keep a cap on the memory usage on the driver and GPU side. Another route migt be to make areAllTextureObjectsLoaded() virtue or have a callback for it so you can customize the behavior. Robert. On Tue, Apr 20, 2010 at 6:21 PM, Serge Lages <[email protected]> wrote: > 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 > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

