mesa: don't flag _NEW_POLYGON_STIPPLE for st/mesa
authorMarek Olšák <marek.olsak@amd.com>
Sat, 10 Jun 2017 10:31:33 +0000 (12:31 +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/attrib.c
src/mesa/main/mtypes.h
src/mesa/main/polygon.c
src/mesa/state_tracker/st_context.c

index 9e86faee346fffb22d665a067448d44a71330cb8..8d4a4f0bc59f060022308d7e986468722891a4b2 100644 (file)
@@ -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;
index d55451a1eac373aa591c9ddbaa38f670f593659a..bc99da97f3e128a1811670977f89d3c84b096e28 100644 (file)
@@ -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;
 };
index 8153c5ec0be0b8cc433970f30e3d8b97fc8188e5..03c63628dfcdd3c8605924739b51d0eb62c05878 100644 (file)
@@ -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,
index b200b900f9494d34b853be777065f418f600381d..41039a0453c4b72d37460950c8a79b2d33f73128 100644 (file)
@@ -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;
 }