summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index d1b2f3a9625..30d275075d5 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1007,12 +1007,14 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum_error;
CHECK_EXTENSION(ARB_depth_clamp, cap);
- if (ctx->Transform.DepthClamp == state)
+ if (ctx->Transform.DepthClampNear == state &&
+ ctx->Transform.DepthClampFar == state)
return;
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 :
_NEW_TRANSFORM);
ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
- ctx->Transform.DepthClamp = state;
+ ctx->Transform.DepthClampNear = state;
+ ctx->Transform.DepthClampFar = state;
break;
case GL_FRAGMENT_SHADER_ATI:
@@ -1684,7 +1686,8 @@ _mesa_IsEnabled( GLenum cap )
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum_error;
CHECK_EXTENSION(ARB_depth_clamp);
- return ctx->Transform.DepthClamp;
+ return ctx->Transform.DepthClampNear ||
+ ctx->Transform.DepthClampFar;
case GL_FRAGMENT_SHADER_ATI:
if (ctx->API != API_OPENGL_COMPAT)