View Full Version : Reasons for glPopAttrib causing indirect errors

12-03-2012, 04:20 AM
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 s.th. 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...

12-03-2012, 04:47 AM
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.

12-03-2012, 06:58 AM
I already did, it is from glPopAttrib :(