mesa: don't flag _NEW_LINE for st/mesa
authorMarek Olšák <marek.olsak@amd.com>
Sat, 10 Jun 2017 10:25:50 +0000 (12:25 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 21 Jun 2017 23:51:02 +0000 (01:51 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/enable.c
src/mesa/main/lines.c
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_context.c

index cb873c9cf57610c121026d8b5203eecf0dcf17cc..752a740c861a9db96aee852e2190a5f73ac8eb4a 100644 (file)
@@ -448,7 +448,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             goto invalid_enum_error;
          if (ctx->Line.SmoothFlag == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_LINE);
+         FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE);
+         ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
          ctx->Line.SmoothFlag = state;
          break;
       case GL_LINE_STIPPLE:
@@ -456,7 +457,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             goto invalid_enum_error;
          if (ctx->Line.StippleFlag == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_LINE);
+         FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE);
+         ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
          ctx->Line.StippleFlag = state;
          break;
       case GL_INDEX_LOGIC_OP:
index 93b80af0dc42d0343cfd69cb9893a1bec1e53672..d83a7d88d12b88e2542c81582042fcea1bbb0bec 100644 (file)
@@ -72,7 +72,8 @@ _mesa_LineWidth( GLfloat width )
       return;
    }
 
-   FLUSH_VERTICES(ctx, _NEW_LINE);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE);
+   ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
    ctx->Line.Width = width;
 
    if (ctx->Driver.LineWidth)
@@ -106,7 +107,8 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
        ctx->Line.StipplePattern == pattern)
       return;
 
-   FLUSH_VERTICES(ctx, _NEW_LINE);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE);
+   ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
    ctx->Line.StippleFactor = factor;
    ctx->Line.StipplePattern = pattern;
 
index 57f775c865da1e4b6bea469d85e35de2f26b10ba..d55451a1eac373aa591c9ddbaa38f670f593659a 100644 (file)
@@ -4520,6 +4520,9 @@ struct gl_driver_flags
    /** gl_context::Transform::DepthClamp */
    uint64_t NewDepthClamp;
 
+   /** gl_context::Line */
+   uint64_t NewLineState;
+
    /** gl_context::Polygon */
    uint64_t NewPolygonState;
 
index cf296c0ea73206b516e358042ca02626e2f94973..b200b900f9494d34b853be777065f418f600381d 100644 (file)
@@ -211,7 +211,6 @@ st_invalidate_state(struct gl_context * ctx)
    }
 
    if (new_state & (_NEW_LIGHT |
-                    _NEW_LINE |
                     _NEW_POINT))
       st->dirty |= ST_NEW_RASTERIZER;
 
@@ -523,6 +522,7 @@ static void st_init_driver_flags(struct st_context *st)
    f->NewClipPlane = ST_NEW_CLIP_STATE;
    f->NewClipPlaneEnable = ST_NEW_RASTERIZER;
    f->NewDepthClamp = ST_NEW_RASTERIZER;
+   f->NewLineState = ST_NEW_RASTERIZER;
    f->NewPolygonState = ST_NEW_RASTERIZER;
    f->NewViewport = ST_NEW_VIEWPORT;
 }