summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorSagar Ghuge <[email protected]>2018-08-21 13:40:55 -0700
committerAnuj Phogat <[email protected]>2018-08-28 12:57:27 -0700
commit27704467401508770181e843e80b46c339b58b74 (patch)
treee14b69b316abd4c6617c0a4bc08c830ac5083666 /src/mesa/main/enable.c
parent5650d3997851007a4e4268a4fa4bd698db41e7dc (diff)
mesa: add support for GL_AMD_depth_clamp_separate tokens
_mesa_set_enable() and _mesa_IsEnabled() extended to accept new two tokens GL_DEPTH_CLAMP_NEAR_AMD and GL_DEPTH_CLAMP_FAR_AMD. v2: Remove unnecessary parentheses (Marek Olsak) Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 30d275075d5..bd3e493da53 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1017,6 +1017,30 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
ctx->Transform.DepthClampFar = state;
break;
+ case GL_DEPTH_CLAMP_NEAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate, cap);
+ if (ctx->Transform.DepthClampNear == state)
+ return;
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 :
+ _NEW_TRANSFORM);
+ ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
+ ctx->Transform.DepthClampNear = state;
+ break;
+
+ case GL_DEPTH_CLAMP_FAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate, cap);
+ if (ctx->Transform.DepthClampFar == state)
+ return;
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 :
+ _NEW_TRANSFORM);
+ ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
+ ctx->Transform.DepthClampFar = state;
+ break;
+
case GL_FRAGMENT_SHADER_ATI:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
@@ -1689,6 +1713,18 @@ _mesa_IsEnabled( GLenum cap )
return ctx->Transform.DepthClampNear ||
ctx->Transform.DepthClampFar;
+ case GL_DEPTH_CLAMP_NEAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate);
+ return ctx->Transform.DepthClampNear;
+
+ case GL_DEPTH_CLAMP_FAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate);
+ return ctx->Transform.DepthClampFar;
+
case GL_FRAGMENT_SHADER_ATI:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;