summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/depth.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-04-21 15:02:17 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-04-21 15:02:17 +0000
commite5b244ff7f984805c1bcc020342f1300f2639c71 (patch)
tree2662820db42730bb1f0269a2aef440309a81d083 /src/mesa/main/depth.c
parent2780bb824f542c47d5412a3909eaa84ed3f13451 (diff)
downloadexternal_mesa3d-e5b244ff7f984805c1bcc020342f1300f2639c71.zip
external_mesa3d-e5b244ff7f984805c1bcc020342f1300f2639c71.tar.gz
external_mesa3d-e5b244ff7f984805c1bcc020342f1300f2639c71.tar.bz2
Implemented GL_EXT_depth_bounds_test.
Diffstat (limited to 'src/mesa/main/depth.c')
-rw-r--r--src/mesa/main/depth.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index 8383bcc..9d95500 100644
--- a/src/mesa/main/depth.c
+++ b/src/mesa/main/depth.c
@@ -1,10 +1,8 @@
-/* $Id: depth.c,v 1.31 2002/10/24 23:57:20 brianp Exp $ */
-
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -116,3 +114,29 @@ _mesa_DepthMask( GLboolean flag )
if (ctx->Driver.DepthMask)
ctx->Driver.DepthMask( ctx, flag );
}
+
+
+
+/* GL_EXT_depth_bounds_test */
+void
+_mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (zmin > zmax) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDepthBoundsEXT(zmin > zmax)");
+ return;
+ }
+
+ zmin = CLAMP(zmin, 0.0, 1.0);
+ zmax = CLAMP(zmax, 0.0, 1.0);
+
+ if (ctx->Depth.BoundsMin == zmin && ctx->Depth.BoundsMax == zmax)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.BoundsMin = zmin;
+ ctx->Depth.BoundsMax = zmax;
+}
+