mesa: Don't call _mesa_ClipControl from glPopAttrib when unsupported.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 4 Nov 2014 02:16:41 +0000 (18:16 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 4 Nov 2014 02:26:08 +0000 (18:26 -0800)
Otherwise, calling glPopAttrib on drivers that don't support
ARB_clip_control gives you a GL error, which is surprising at best.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/attrib.c

index 5345339f6adb8db33877fb9984803dd15ee3a95e..4684615a8808a3dc049a133802978d11208754c7 100644 (file)
@@ -1345,7 +1345,8 @@ _mesa_PopAttrib(void)
                if (xform->DepthClamp != ctx->Transform.DepthClamp)
                   _mesa_set_enable(ctx, GL_DEPTH_CLAMP,
                                    ctx->Transform.DepthClamp);
-               _mesa_ClipControl(xform->ClipOrigin, xform->ClipDepthMode);
+               if (ctx->Extensions.ARB_clip_control)
+                  _mesa_ClipControl(xform->ClipOrigin, xform->ClipDepthMode);
             }
             break;
          case GL_TEXTURE_BIT: