summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/common/meta.c10
-rw-r--r--src/mesa/main/polygon.c8
2 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 29f35bfb89f..46cda731e1b 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -851,8 +851,14 @@ _mesa_meta_end(struct gl_context *ctx)
}
if (state & MESA_META_RASTERIZATION) {
- _mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode);
- _mesa_PolygonMode(GL_BACK, save->BackPolygonMode);
+ /* Core context requires that front and back mode be the same.
+ */
+ if (ctx->API == API_OPENGL_CORE) {
+ _mesa_PolygonMode(GL_FRONT_AND_BACK, save->FrontPolygonMode);
+ } else {
+ _mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode);
+ _mesa_PolygonMode(GL_BACK, save->BackPolygonMode);
+ }
if (ctx->API == API_OPENGL) {
_mesa_set_enable(ctx, GL_POLYGON_STIPPLE, save->PolygonStipple);
_mesa_set_enable(ctx, GL_POLYGON_SMOOTH, save->PolygonSmooth);
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);