summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/polygon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/polygon.c')
-rw-r--r--src/mesa/main/polygon.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index 4caf62adfea..1bb7190bc24 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -131,8 +131,17 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
_mesa_enum_to_string(face),
_mesa_enum_to_string(mode));
- if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
+ switch (mode) {
+ case GL_POINT:
+ case GL_LINE:
+ case GL_FILL:
+ break;
+ case GL_FILL_RECTANGLE_NV:
+ if (ctx->Extensions.NV_fill_rectangle)
+ break;
+ /* fall-through */
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glPolygonMode(mode)");
return;
}