Stack overflow with FBO

Started by
3 comments, last by WilyCoder 16 years, 9 months ago
Sorry to bother you guys with my question. I'm using FBO to generate render target. The render target is a GL_TEXTURE_RECTANGLE_ARB texture. At first everything seems just OK. But after couples of iterations, FBO reports stack overflow error. It seems FBO keeps consuming the graphics memory till "out of memory" OpenGL error takes place. I traced the code, and found out that stack overflow error happens when I attache a texture to the FBO (error on :glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_ARB, tex, 0);). So what's the possible reason for this issue? Can someone give me a hint or a direction for the problem. Thank you guys so much!
Advertisement
u only do this once, ie when u create a FBO
if u want to use this FBO

then u use
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, framebufferID );
not necessarily(e.g.: sampling a cube map with the same fbo), stack overflows are usually caused by glPush* operations.
The error output may be delayed to the line where you attach the textures to the fbo, since you usually check the fbo state before proceeding with rendering to the fbo.

a) check for glPush(Matrix,Attribute,...) operations
b) do you unbind VBOs?
c) do you unbind FBOs?

Can you print the error message please?
http://www.8ung.at/basiror/theironcross.html
Thank you for your guys reply.

Basiror is right, I have a glPushMatrix and glPopMatrix mismatch in my code, which is not quite obvious before. Really rookie mistake.

Thank you again for your kindly help.
I've learned to check matrix ops FIRST any time there is a stack overflow.

ymmv.

This topic is closed to new replies.

Advertisement