Module: Mesa
Branch: master
Commit: 13fedf2883c7a1d7ff911b75eb88df00ba22eea7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=13fedf2883c7a1d7ff911b75eb88df00ba22eea7

Author: Paul Berry <stereotype...@gmail.com>
Date:   Mon Aug  5 15:46:43 2013 -0700

main: Fix deprecation of glLineWidth()

>From section E.1 (Profiles and Deprecated Features of OpenGL 3.0)
of the OpenGL 3.0 spec:

    "LineWidth is not deprecated, but values greater than 1.0
    will generate an INVALID VALUE error"

>From context it is clear that values greater than 1.0 should only
generate an INVALID VALUE error in a forward-compatible context.

The code was correctly quoting this spec text, but it was disallowing
all line widths in forward-compatible contexts, instead of just widths
greater than 1.0.

This patch introduces the correct check, so that setting a line width
of 1.0 or less is permitted.

Reviewed-by: Matt Turner <matts...@gmail.com>
Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>

---

 src/mesa/main/lines.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index 0df9d66..3c08ed2 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -62,7 +62,8 @@ _mesa_LineWidth( GLfloat width )
     */
    if (ctx->API == API_OPENGL_CORE
        && ((ctx->Const.ContextFlags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
-           != 0)) {
+           != 0)
+       && width > 1.0) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
       return;
    }

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to