summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/polygon.c27
-rw-r--r--src/mesa/main/polygon.h2
2 files changed, 18 insertions, 11 deletions
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index 49a60e8e533..7ad536fe5e0 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -101,19 +101,14 @@ _mesa_CullFace(GLenum mode)
* flushes the vertices and notifies the driver via
* the dd_function_table::FrontFace callback.
*/
-void GLAPIENTRY
-_mesa_FrontFace( GLenum mode )
+static ALWAYS_INLINE void
+front_face(struct gl_context *ctx, GLenum mode, bool no_error)
{
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glFrontFace %s\n", _mesa_enum_to_string(mode));
-
if (ctx->Polygon.FrontFace == mode)
return;
- if (mode!=GL_CW && mode!=GL_CCW) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
+ if (!no_error && mode != GL_CW && mode != GL_CCW) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glFrontFace");
return;
}
@@ -122,7 +117,19 @@ _mesa_FrontFace( GLenum mode )
ctx->Polygon.FrontFace = mode;
if (ctx->Driver.FrontFace)
- ctx->Driver.FrontFace( ctx, mode );
+ ctx->Driver.FrontFace(ctx, mode);
+}
+
+
+void GLAPIENTRY
+_mesa_FrontFace(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glFrontFace %s\n", _mesa_enum_to_string(mode));
+
+ front_face(ctx, mode, false);
}
diff --git a/src/mesa/main/polygon.h b/src/mesa/main/polygon.h
index 78c7f711642..b9570cd1883 100644
--- a/src/mesa/main/polygon.h
+++ b/src/mesa/main/polygon.h
@@ -46,7 +46,7 @@ extern void GLAPIENTRY
_mesa_CullFace(GLenum mode);
extern void GLAPIENTRY
-_mesa_FrontFace( GLenum mode );
+_mesa_FrontFace(GLenum mode);
extern void GLAPIENTRY
_mesa_PolygonMode( GLenum face, GLenum mode );