Jump to content
  • Advertisement
Sign in to follow this  
Tiresias

OpenGL leak in some pc?

This topic is 3103 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello this is quiet a strange issue, i just want first to see if someone already faced it or if there are obvious repsonses. I have a 2d application based on SDL/OpenGL (and cegui but lets assume problem is not in cegui). i have a big leak on some PC only (even sometimes memory figure doesnt make sense) when i am loading some 2d textures and freeing them. to load a texture i do: SDL_Surface *t = IMG_Load(filename); hxSurface *work = LoadSurface(path,t); SDL_FreeSurface(t); where LoadSurface is kind of: glGenTextures() and in the freeSurface i do a: glDeleteTextures() in the render loop i do: pushmatrix(); glBindTexture(GL_TEXTURE_2D, target->textureList[(i*target->xChunks)+j]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glBegin(GL_QUADS); glTexCoord2f(u1, v1); glVertex2f(sx, sy); glTexCoord2f(u2, v1); glVertex2f(sx+sw, sy); glTexCoord2f(u2, v2); glVertex2f(sx+sw, sy+sh); glTexCoord2f(u1, v2); glVertex2f(sx, sy+sh); glEnd(); popmatrix(); this is basic code; my nigtmare is that on some pc it works. and others no. obsviously on my development setup there is no leak .... any idea about something i forgot and that is ok on some drivers; not ok on some others? looks like on integrated intel graphic card problem is present.

Share this post


Link to post
Share on other sites
Advertisement
What exactly told you the leak come from the textures? Of course, doing a IMG_Load() and then a SDL_FreeSurface() is not supposed to leak. Same thing for a glGenTextures()/glDeleteTextures() pair. You say you call glDeleteTextures() in "freeSurface", are you sure this is called for every textures created? It would be great to see the complete LoadSurface()/freeSurface() code if they do anything else. What if you try only loading/deleting SDL surface, and then only loading/deleting OpenGL textures, maybe you can pinpoint the culprit.

I really doubt video card drivers can cause a leak. The difference between computers is strange. Are you running in debug or release mode and was it the same between the two computers?

Share this post


Link to post
Share on other sites
hi
thanks to reply,
in fact i dont think it is a "high level code" issue because as i said on most computers there is NO leaks. And textures are pretty bigs, so really if some high level code error was there i would have detected on all pcs.
And when leak occurs it is big.
The version is debug on both platform.

In fact another clue is that it looks like memory usages (ram memory) seems to increase extremely fast on leaking pc. could it be that some card cannot stores the textures in their video memory so this special scenario make ram to increase and expose some error code return from opengl api that i would not handle properly ?

hehe this one will busy me some times ...

any idea welcome!

(i will post code if i cannot find issue quickly)

Share this post


Link to post
Share on other sites
actually i did run with glintercept,
and the glError.txt contains only this:

GL Intercept Log. Version : 0.5 Compile Date: Dec 3 2005 Run on: Wed Feb 17 23:49:30 2010

===================================================
GLDriver - Shutdown - Current OpenGL context 0x10000?
GLDriver - Shutdown - Outstanding OpenGL context 0x10000 ?
===================================================
Log End.

i will try to install it on faulty graphic card,

Share this post


Link to post
Share on other sites
You aren't destroying your GL context but when your exe closes, the driver automatically frees all allocated memory and the OS deallocates your exe and all the memory allocated on the heap.

Share this post


Link to post
Share on other sites
ok but if during run time the error doesnt show leaking context it means all is ok right?
i am a bit surprised to see this error file empty, maybe i didnt make any mistakes :)

anyway i guess i will try to run it on faulty pc then maybe i will see some interesting errors.

Share this post


Link to post
Share on other sites
Hello
it could help
actually on a faulty pc i got this with glintercept which is suspicious :

ImageManager::Destructor - OpenGL id 1 is still active.
...
x 400 times when my application exit.

on my pc i didnt see this. This leak is texture related right ?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!