diff options
author | Ian Romanick <[email protected]> | 2012-08-17 16:03:06 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-29 15:09:36 -0700 |
commit | 7e1cab09a155a0f986342323624f460340de355f (patch) | |
tree | 17ba260a01f1c74bb7bc4ec245f20abbfa2ad21b /src/mesa/drivers/common | |
parent | d638da23d2ec2e9c52655b1ea138249e7f8bcccb (diff) |
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 <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 10 |
1 files changed, 8 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); |