Reasons for glPopAttrib causing indirect errors

Hi everyone,

I have a glPopAttrib causing a GL_INVALID_OPERATION. According to the man pages glPopAttrib may cause a GL_INVALID_OPERATION if it is executed between glBegin and glEnd.
However, this ist not the case and i remember vaguely that i had a case once where the internal state could not be restored - i think it had to do with the impossibility to restore a glReadBuffer pointing to a FBO color attachment point, because the bound framebuffer changed in the meantime (between push and pop).

(1) Are there any other known cases where popAttrib might fail with GL_INVALID_OPERATION? (i make heavy use of shaders, VBO, FBO)

(2) Are there any more possibilities to debug this except glGetError and comparing state before /after push and pop?

Thanks for your help…

glGetError is the only (and very poor) method of detecting errors unless you have an AMD card; although the new 4.3 drivers are promising more.
Your error need not be from the glPopAttrib - put a call to glGetError before glPopAttrib to confirm this.
Also make sure your glPushAttrib/glPopAttrib match.

I already did, it is from glPopAttrib :frowning: