From 58a02196b99d375481af5abfdcba967167f99d7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 10 Jun 2017 12:25:50 +0200 Subject: [PATCH] mesa: don't flag _NEW_LINE for st/mesa MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle Reviewed-by: Brian Paul Reviewed-by: Timothy Arceri --- src/mesa/main/enable.c | 6 ++++-- src/mesa/main/lines.c | 6 ++++-- src/mesa/main/mtypes.h | 3 +++ src/mesa/state_tracker/st_context.c | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index cb873c9..752a740c 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -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: diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 93b80af..d83a7d8 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -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; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 57f775c..d55451a 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -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; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index cf296c0..b200b90 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -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; } -- 2.7.4