summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-10 12:18:34 +0200
committerMarek Olšák <[email protected]>2017-06-22 01:51:02 +0200
commitbc871a1baf8979310eb7adc1b87342e389616027 (patch)
treef94a58f7dfcea798dbd13b51ec831c92d378cc85
parent00173d91b70ae4dcea7c6324ee4858c498cae14b (diff)
mesa: don't flag _NEW_POLYGON for st/mesa
Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/mesa/main/enable.c24
-rw-r--r--src/mesa/main/mtypes.h3
-rw-r--r--src/mesa/main/polygon.c18
-rw-r--r--src/mesa/main/viewport.c5
-rw-r--r--src/mesa/state_tracker/st_context.c4
5 files changed, 39 insertions, 15 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 2f348d8940f..cb873c9cf57 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -382,7 +382,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
case GL_CULL_FACE:
if (ctx->Polygon.CullFlag == state)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx,
+ ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.CullFlag = state;
break;
case GL_DEPTH_TEST:
@@ -650,7 +652,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
goto invalid_enum_error;
if (ctx->Polygon.SmoothFlag == state)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx,
+ ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.SmoothFlag = state;
break;
case GL_POLYGON_STIPPLE:
@@ -658,7 +662,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
goto invalid_enum_error;
if (ctx->Polygon.StippleFlag == state)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx,
+ ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.StippleFlag = state;
break;
case GL_POLYGON_OFFSET_POINT:
@@ -666,7 +672,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
goto invalid_enum_error;
if (ctx->Polygon.OffsetPoint == state)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx,
+ ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.OffsetPoint = state;
break;
case GL_POLYGON_OFFSET_LINE:
@@ -674,13 +682,17 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
goto invalid_enum_error;
if (ctx->Polygon.OffsetLine == state)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx,
+ ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.OffsetLine = state;
break;
case GL_POLYGON_OFFSET_FILL:
if (ctx->Polygon.OffsetFill == state)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx,
+ ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.OffsetFill = state;
break;
case GL_RESCALE_NORMAL_EXT:
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 2d27e767a2a..57f775c865d 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::Polygon */
+ uint64_t NewPolygonState;
+
/** gl_context::ViewportArray */
uint64_t NewViewport;
};
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index e509fe4d989..8153c5ec0be 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -66,7 +66,8 @@ _mesa_CullFace( GLenum mode )
if (ctx->Polygon.CullFaceMode == mode)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.CullFaceMode = mode;
if (ctx->Driver.CullFace)
@@ -101,7 +102,8 @@ _mesa_FrontFace( GLenum mode )
return;
}
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.FrontFace = mode;
if (ctx->Driver.FrontFace)
@@ -153,13 +155,15 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
}
if (ctx->Polygon.FrontMode == mode)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.FrontMode = mode;
break;
case GL_FRONT_AND_BACK:
if (ctx->Polygon.FrontMode == mode && ctx->Polygon.BackMode == mode)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.FrontMode = mode;
ctx->Polygon.BackMode = mode;
break;
@@ -170,7 +174,8 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
}
if (ctx->Polygon.BackMode == mode)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.BackMode = mode;
break;
default:
@@ -252,7 +257,8 @@ _mesa_polygon_offset_clamp(struct gl_context *ctx,
ctx->Polygon.OffsetClamp == clamp)
return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON);
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.OffsetFactor = factor;
ctx->Polygon.OffsetUnits = units;
ctx->Polygon.OffsetClamp = clamp;
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 51ae6692f7b..5529f55ee71 100644
--- a/src/mesa/main/viewport.c
+++ b/src/mesa/main/viewport.c
@@ -460,7 +460,10 @@ _mesa_ClipControl(GLenum origin, GLenum depth)
ctx->Transform.ClipOrigin = origin;
/* Affects the winding order of the front face. */
- ctx->NewState |= _NEW_POLYGON;
+ if (ctx->DriverFlags.NewPolygonState)
+ ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
+ else
+ ctx->NewState |= _NEW_POLYGON;
if (ctx->Driver.FrontFace)
ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 23aad0a1f41..cf296c0ea73 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -212,8 +212,7 @@ st_invalidate_state(struct gl_context * ctx)
if (new_state & (_NEW_LIGHT |
_NEW_LINE |
- _NEW_POINT |
- _NEW_POLYGON))
+ _NEW_POINT))
st->dirty |= ST_NEW_RASTERIZER;
if (new_state & _NEW_PROJECTION &&
@@ -524,6 +523,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->NewPolygonState = ST_NEW_RASTERIZER;
f->NewViewport = ST_NEW_VIEWPORT;
}