Any ideas on this one. I looked into it a bit and the behavior I am thinking about is something like this:
- After texture has been bound, the system automatically sets image to NullFC - This frees the image fc memory - The code detects that the system was the one that set the image to NullFC and checks if the "allow null flag" is set. If so, it goes about it's merry way. This means that even if the flag is set, if the user sets NullFC, the system does it's normal behavior of unbinding the texture. Before I put time into implementing this though, does this behavior make sense and do people think it would be valuable in OpenSG? (ie. will a patch be accepted) -Allen On Mon, Dec 29, 2008 at 2:56 PM, Allen Bierbaum <[email protected]> wrote: > In our current application, we dynamically load a *lot* of textures > into the system. The textures are taking up a great deal of memory > and I am looking for a way to reduce this memory consumption. Before > I get to my idea though, here is the process I think the textures are > going through. > > 1. Texture file loaded into OSG::Image. (system memory, size of base texture) > 2. OSG::Texture created that references OSG::Image. internal format is > set to compressed. > 3. OpenSG binds the texture, texture is uploaded to OpenGL driver which: > - stores a copy of the texture on the graphics board (compressed) > - (potentially) stores a copy of the texture in the driver memory > to support paging > > The long and short of it is that I see the potential that the system > is storing 3 copies of the entire texture when I really only need the > single copy stored on the graphics board. If the driver stores a copy > in system memory, there is nothing I can do about that, but I would > like to remove the memory consumed by the OSG::Image that sits around > after the image has been bound. > > I know that for some cases this image needs to stay around, but for > our cases it doesn't so I would like to make it optional. > > What I propose is adding a flag to OSG::Texture that if set true: > - sets the image for the texture to NullFC after the texture has been bound > - thus allows reference counting to collect the OSG::Image and reclaim > the memory > > Would this work? What would it take to add? Can anyone help me out? > > -Allen > ------------------------------------------------------------------------------ _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
