Page 1 of 1

Problem when loading more than 128 textures

Posted: Sun Jun 21, 2009 2:29 pm
by raytaller
Hello
Context : Irrlicht 1.5, Win32, OpenGL or DirectX

I have some textures that I load :
driver->getTexture(...)
driver->getTexture(...)

and then I unload everything :
driver->removeAllTextures();

When I repeat this until driver->getTexture is called 128 times, my program no longer displays textures correctly (ie : some of the textured quads are not visible). I'm not calling drop() on any loaded texture.
Looking at the OpenGL driver code, I can't see why there would be any limitation on 128 textures loaded.

Any idea of what could cause this ?
I'll try to reproduce the bug on a standard demo

Posted: Sun Jun 21, 2009 3:53 pm
by Sylence
Maybe a driver or hardware limitation ?

Posted: Sun Jun 21, 2009 11:18 pm
by raytaller
Well, the problem is that it occurs even if removeAllTexture is called between the loadings... I was only stress-testing my save/load game system, so the number of loaded images is always the same.

The log says something like :
Loaded texture A
Loaded texture B
Loaded texture C

driver->removeAllTextures()

Loaded texture A
Loaded texture B
Loaded texture C

etc.

which proves that textures are indeed unloaded.
Unfortunately, I didn't manage to reproduce the bug on the samples, so I'll have to simplify my code until I can show explicit the bug here

Posted: Mon Jun 22, 2009 7:46 am
by raytaller
Ok never mind, it certainly comes from my code