* 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;
}
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);
}