Multiple instances of cached texture uploaded to GPU memory?

Just downloaded gDEBugger and playing around with it’s possibilities on the jme3 test program I’m testing.



I have 10 objects which share the same texture. Texture is cached correctly when loading from asset manager, but I’m getting new copies of it each time (because it is ‘cloned’ after being found in cache). Seems that when I display objects in the scene, I end up with 10 copies of texture in GPU memory.



I can solve it in this case by sharing the material itself, as opposed to depending on asset manager to cache the texture. In that case, I get only one copy of texture data on the GPU.



Is there any particular reason why two instances of same texture image (same as in coming from same slot in asset manager) end up uploaded twice to GPU? Maybe I have missed some kind of extra switch to make it ‘immutable’ to enable sharing it ?

Hm basically the assetmanager should share the textures automatically if you load everything with the help of it. Seems like a bug to me. However you are sure it is 10 times in the vram or is it 10 times uploaded ( wich might be very possible that the opengl driver is unloading it when not needed further or similar)

We talked about it with Kirill, and it definitely is an issue. We are planning to change the way Images are managed in the engine so they are proper globjects.

Thanks for the analysis abies.

Seems that latest corrections have fixed this issue. I’m leaving texture caching to asset manager and I have only one version of it in GPU memory.



Thanks a lot for the fix.

Good to hear, Momoko_Fan (Kirill) tackled this in no time :stuck_out_tongue:

Thanks again for the feed back!