Texture Memory management

Started by
0 comments, last by MJP 10 years, 10 months ago
Am working on a graphics application which requires me to create Textures at run-time. Here are some interesting scenarios that I encountered.
1) If initially, I use Low Resolution textures (say 256x256), the texture Creation (and hence interactivity) is pretty fast
2) The moment I switch to High resolution textures (say 2048x2048), the texture creation slows down. This is pretty much understandable
3) I delete all the high res textures and start going back to the creation of Low res textures.
The funny part is that, even upon deletion of these High Res textures I never get the same speed (interactivity) back.
I monitored the GPU memory usage using GPU-Z. I have Nvidia GTX 460 (1GB VRAM) card
1) Initially, on Low res texture creation the memory usage reaches around 650-700MB
2) Upon converting to High Res Textures (the memory jumps to around 850-900MB (should have gone further up), and then keeps hovering around the mark.
3) Upon deletion of the High Res Textures it comes back to around 350-400 MB back
But it never acquires the same speed or performance again.
Is the sluggishness due to usage of any Shared memory (instead of the dedicated memory) by the Card?
If so, then why is it still using the Shared memory when all the textures have been released and only about 350MB is being used?
Have been predominantly using the OpenGL Rendering System.
Haven't tried on DirectX. Issue has been noted on Win7 and Win8 OS.
Haven't tested it out on MacOS.
Is there anyway to ensure that the Texture Usage is confined to the dedicated memory?
A crash due to non-availability of Video memory is preferable than sluggish interactivity.
Advertisement

So if I understand you correctly, you're constantly creating new textures every frame? You may just be hitting a sub-optimal path of the memory allocator inside the driver, due to fragmentation and/or repeated allocations and de-allocations. Perhaps you could re-use textures instead of creating new ones?

This topic is closed to new replies.

Advertisement