mesa/tests: Sanity check the ES2 dispatch table
[mesa.git] / src / mesa / main / polygon.c
index addca0228d5092ebc00c8030da84681d40ff6047..d7d52daa89ef1cddd532323e732c66f100385174 100644 (file)
@@ -143,6 +143,10 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
 
    switch (face) {
    case GL_FRONT:
+      if (ctx->API == API_OPENGL_CORE) {
+         _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
+         return;
+      }
       if (ctx->Polygon.FrontMode == mode)
         return;
       FLUSH_VERTICES(ctx, _NEW_POLYGON);
@@ -157,6 +161,10 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
       ctx->Polygon.BackMode = mode;
       break;
    case GL_BACK:
+      if (ctx->API == API_OPENGL_CORE) {
+         _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
+         return;
+      }
       if (ctx->Polygon.BackMode == mode)
         return;
       FLUSH_VERTICES(ctx, _NEW_POLYGON);