if (TEST_EQ_4V(ctx->Transform.EyeUserPlane[p], equation))
return;
+ /* EyeUserPlane is used by program state constants. */
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->NewDriverState |= ctx->DriverFlags.NewClipPlane;
COPY_4FV(ctx->Transform.EyeUserPlane[p], equation);
if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
== ((GLuint) state << p))
return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ /* The compatibility profile needs _NEW_TRANSFORM to transform
+ * clip planes according to the projection matrix.
+ */
+ if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES ||
+ !ctx->DriverFlags.NewClipPlaneEnable) {
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ } else {
+ FLUSH_VERTICES(ctx, 0);
+ }
+ ctx->NewDriverState |= ctx->DriverFlags.NewClipPlaneEnable;
if (state) {
ctx->Transform.ClipPlanesEnabled |= (1 << p);
CHECK_EXTENSION(ARB_depth_clamp, cap);
if (ctx->Transform.DepthClamp == state)
return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 :
+ _NEW_TRANSFORM);
+ ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
ctx->Transform.DepthClamp = state;
break;
/** gl_context::Stencil */
uint64_t NewStencil;
- /** gl_context::Transform::Clip* */
+ /** gl_context::Transform::ClipOrigin/ClipDepthMode */
uint64_t NewClipControl;
+ /** gl_context::Transform::EyeUserPlane */
+ uint64_t NewClipPlane;
+
+ /** gl_context::Transform::ClipPlanesEnabled */
+ uint64_t NewClipPlaneEnable;
+
+ /** gl_context::Transform::DepthClamp */
+ uint64_t NewDepthClamp;
+
/** gl_context::ViewportArray */
uint64_t NewViewport;
};
if (new_state & (_NEW_LIGHT |
_NEW_LINE |
_NEW_POINT |
- _NEW_POLYGON |
- _NEW_TRANSFORM))
+ _NEW_POLYGON))
st->dirty |= ST_NEW_RASTERIZER;
- if (new_state & (_NEW_PROJECTION |
- _NEW_TRANSFORM) &&
+ if (new_state & _NEW_PROJECTION &&
st_user_clip_planes_enabled(ctx))
st->dirty |= ST_NEW_CLIP_STATE;
}
f->NewClipControl = ST_NEW_VIEWPORT | ST_NEW_RASTERIZER;
+ f->NewClipPlane = ST_NEW_CLIP_STATE;
+ f->NewClipPlaneEnable = ST_NEW_RASTERIZER;
+ f->NewDepthClamp = ST_NEW_RASTERIZER;
f->NewViewport = ST_NEW_VIEWPORT;
}