From df0f6a0af31c63e6b66657fbc01c0955558fc282 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 10 Jun 2017 12:31:33 +0200 Subject: [PATCH] mesa: don't flag _NEW_POLYGON_STIPPLE 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/attrib.c | 7 ++++++- src/mesa/main/mtypes.h | 3 +++ src/mesa/main/polygon.c | 4 +++- src/mesa/state_tracker/st_context.c | 4 +--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 9e86fae..8d4a4f0 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1287,7 +1287,12 @@ _mesa_PopAttrib(void) break; case GL_POLYGON_STIPPLE_BIT: memcpy( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) ); - ctx->NewState |= _NEW_POLYGONSTIPPLE; + + if (ctx->DriverFlags.NewPolygonStipple) + ctx->NewDriverState |= ctx->DriverFlags.NewPolygonStipple; + else + ctx->NewState |= _NEW_POLYGONSTIPPLE; + if (ctx->Driver.PolygonStipple) ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data ); break; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d55451a..bc99da9 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -4526,6 +4526,9 @@ struct gl_driver_flags /** gl_context::Polygon */ uint64_t NewPolygonState; + /** gl_context::PolygonStipple */ + uint64_t NewPolygonStipple; + /** gl_context::ViewportArray */ uint64_t NewViewport; }; diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index 8153c5e..03c6362 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -199,7 +199,9 @@ _mesa_PolygonStipple(const GLubyte *pattern) if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glPolygonStipple\n"); - FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonStipple ? 0 : + _NEW_POLYGONSTIPPLE); + ctx->NewDriverState |= ctx->DriverFlags.NewPolygonStipple; pattern = _mesa_map_validate_pbo_source(ctx, 2, &ctx->Unpack, 32, 32, 1, diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index b200b90..41039a0 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -199,9 +199,6 @@ st_invalidate_state(struct gl_context * ctx) if (new_state & _NEW_FOG) st->dirty |= ST_NEW_FS_STATE; - if (new_state & _NEW_POLYGONSTIPPLE) - st->dirty |= ST_NEW_POLY_STIPPLE; - if (new_state & _NEW_FRAG_CLAMP) { if (st->clamp_frag_color_in_shader) st->dirty |= ST_NEW_FS_STATE; @@ -524,6 +521,7 @@ static void st_init_driver_flags(struct st_context *st) f->NewDepthClamp = ST_NEW_RASTERIZER; f->NewLineState = ST_NEW_RASTERIZER; f->NewPolygonState = ST_NEW_RASTERIZER; + f->NewPolygonStipple = ST_NEW_POLY_STIPPLE; f->NewViewport = ST_NEW_VIEWPORT; } -- 2.7.4