X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Flines.c;h=78d3a7729b9b2f96733de1e284c0e659731ee7b4;hb=42842306d3c7ba71f89022a1ebb09a4454a1b6e0;hp=4df658794d6f3d526f8cf552ba5ab912fc197914;hpb=110dda0e3f451c87bfa9a8f0e023547d1ed3803f;p=mesa.git diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 4df658794d6..78d3a7729b9 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -37,19 +37,14 @@ * * \sa glLineWidth(). */ -void GLAPIENTRY -_mesa_LineWidth( GLfloat width ) +static ALWAYS_INLINE void +line_width(struct gl_context *ctx, GLfloat width, bool no_error) { - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glLineWidth %f\n", width); - /* If width is unchanged, there can't be an error */ if (ctx->Line.Width == width) return; - if (width <= 0.0F) { + if (!no_error && width <= 0.0F) { _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" ); return; } @@ -64,7 +59,7 @@ _mesa_LineWidth( GLfloat width ) * *NOT* removed in a later spec. Therefore, we only disallow this in a * forward compatible context. */ - if (ctx->API == API_OPENGL_CORE + if (!no_error && ctx->API == API_OPENGL_CORE && ((ctx->Const.ContextFlags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) != 0) && width > 1.0F) { @@ -81,6 +76,26 @@ _mesa_LineWidth( GLfloat width ) } +void GLAPIENTRY +_mesa_LineWidth_no_error(GLfloat width) +{ + GET_CURRENT_CONTEXT(ctx); + line_width(ctx, width, true); +} + + +void GLAPIENTRY +_mesa_LineWidth(GLfloat width) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glLineWidth %f\n", width); + + line_width(ctx, width, false); +} + + /** * Set the line stipple pattern. *