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:
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:
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:
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:
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:
/** gl_context::Transform::DepthClamp */
uint64_t NewDepthClamp;
+ /** gl_context::Polygon */
+ uint64_t NewPolygonState;
+
/** gl_context::ViewportArray */
uint64_t NewViewport;
};
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)
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)
}
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;
}
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:
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;
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);
if (new_state & (_NEW_LIGHT |
_NEW_LINE |
- _NEW_POINT |
- _NEW_POLYGON))
+ _NEW_POINT))
st->dirty |= ST_NEW_RASTERIZER;
if (new_state & _NEW_PROJECTION &&
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;
}