There was a message that was deleted, I'm not sure if you still expect a reply, but I'll try to give a generic one without referencing it:
First, make sure you use compressed textures as much as possible (for read-only textures). That's not just good for memory, but will also greatly improve performance. If you still have memory issues, my advice is to detect available memory and adjust the application accordingly (e.g. by dropping mip 0 from large textures), rather than attempt to juggle memory between host and device. That's because said juggling is costly, and also a device with low memory is probably not strong enough to give good performance accessing large amount of memory anyway.
If you still need memory to be juggled, you can implement that in the application itself, which knows better when the texture is not going to be used anymore (e.g. moving out of a zone in a game). To that end, you can either:
- Copy the texture to PBO (which will have HOST_VISIBLE memory), delete it. When needed again, reupload the texture from PBO.
- Or, if you only apply this to read-only textures, delete the texture when not needed, and reload it again when needed.
Hope that helps. Cheers,