Better driver notification on changes.
[mesa.git] / src / mesa / main / depth.c
index d92423dcee16c7ef9063a0071443bc923c0dfc72..aca471a06c876d965c7acaf0f5b42b53995205e6 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.1
+ * Version:  6.3
  *
- * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2005  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"),
@@ -119,7 +119,9 @@ _mesa_DepthMask( GLboolean flag )
 
 
 
-/* GL_EXT_depth_bounds_test */
+/**
+ * Specified by the GL_EXT_depth_bounds_test extension.
+ */
 void GLAPIENTRY
 _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
 {
@@ -147,6 +149,10 @@ _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
 /*****                      Initialization                        *****/
 /**********************************************************************/
 
+
+/**
+ * Initialize the depth buffer attribute group in the given context.
+ */
 void _mesa_init_depth( GLcontext * ctx )
 {
    /* Depth buffer group */
@@ -156,13 +162,15 @@ void _mesa_init_depth( GLcontext * ctx )
    ctx->Depth.Mask = GL_TRUE;
    ctx->Depth.OcclusionTest = GL_FALSE;
 
+   /* XXX this is now per-framebuffer state */
+#if 00
    /* Z buffer stuff */
    if (ctx->Visual.depthBits == 0) {
       /* Special case.  Even if we don't have a depth buffer we need
        * good values for DepthMax for Z vertex transformation purposes
        * and for per-fragment fog computation.
        */
-      ctx->DepthMax = 1 << 16;
+      ctx->DepthMax = (1 << 16) - 1;
       ctx->DepthMaxF = (GLfloat) ctx->DepthMax;
    }
    else if (ctx->Visual.depthBits < 32) {
@@ -177,4 +185,5 @@ void _mesa_init_depth( GLcontext * ctx )
       ctx->DepthMaxF = (GLfloat) ctx->DepthMax;
    }
    ctx->MRD = 1.0;  /* Minimum resolvable depth value, for polygon offset */
+#endif
 }