diff options
author | Marek Olšák <[email protected]> | 2017-06-10 12:09:43 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-06-22 01:51:02 +0200 |
commit | 00173d91b70ae4dcea7c6324ee4858c498cae14b (patch) | |
tree | 1f3f7bcf4f7b17b1be58d50123d7b7efec8b6356 /src/mesa/main/enable.c | |
parent | 55f1106637a122f6b6c91d45acb721398328cc17 (diff) |
mesa: don't flag _NEW_TRANSFORM for st/mesa if possible
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r-- | src/mesa/main/enable.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f5bd48cd90f..2f348d8940f 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -346,7 +346,16 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) == ((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); @@ -973,7 +982,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) 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; |