From 7e1cab09a155a0f986342323624f460340de355f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 17 Aug 2012 16:03:06 -0700 Subject: mesa: Only FRONT_AND_BACK is allowed for PolygonMode in core context Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says (in the list of deprecated functionality): "Separate polygon draw mode - PolygonMode face values of FRONT and BACK; polygons are always drawn in the same mode, no matter which face is being rasterized." Also modify meta to not use FRONT or BACK in a core context. Signed-off-by: Ian Romanick --- src/mesa/main/polygon.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mesa/main/polygon.c') diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index addca0228d5..d7d52daa89e 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -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); -- cgit v1.2.3