ImageEngine/cortex — pull request #56 by johnhaddon (2013-07-31 02:15:27+00:00)
Title: Reduced use of GL matrix stack.

We were experiencing crashes in the Maya SceneShape, because it creates IECoreGL::Scenes with a much higher depth of nesting than is contained in the actual cache itself. This meant we ran off the end of the GL matrix stack with unfortunate consequences. The real long term solution is to stop using the GL stack entirely (it's deprecated) as documented in the comments, but this commit just avoids calling glPushMatrix() when the matrix is identity. Because the SceneShape creates a large number of identity transforms (at least one per cache level as far as I can see), this is quite effective.