[intel] Assert against conflicting relocation emits in bufmgr_fake.c
[mesa.git] / src / mesa / drivers / dri / common / depthtmp.h
index 74273165e458909a7361743c2b02eb6a6501af44..55199abf6a3f4e317df88c4110b5891774100af2 100644 (file)
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/common/depthtmp.h,v 1.5 2001/03/21 16:14:20 dawes Exp $ */
 
 /*
  * Notes:
@@ -8,25 +7,20 @@
  */
 
 
+#include "spantmp_common.h"
+
 #ifndef DBG
 #define DBG 0
 #endif
 
-
 #ifndef HAVE_HW_DEPTH_SPANS
 #define HAVE_HW_DEPTH_SPANS 0
 #endif
+
 #ifndef HAVE_HW_DEPTH_PIXELS
 #define HAVE_HW_DEPTH_PIXELS 0
 #endif
 
-#ifndef HW_READ_LOCK
-#define HW_READ_LOCK()         HW_LOCK()
-#endif
-#ifndef HW_READ_UNLOCK
-#define HW_READ_UNLOCK()       HW_UNLOCK()
-#endif
-
 static void TAG(WriteDepthSpan)( GLcontext *ctx,
                                  struct gl_renderbuffer *rb,
                                  GLuint n, GLint x, GLint y,
@@ -153,8 +147,17 @@ static void TAG(WriteDepthPixels)( GLcontext *ctx,
 #else
         HW_CLIPLOOP()
            {
-              for ( i = 0 ; i < n ; i++ ) {
-                 if ( mask[i] ) {
+              if ( mask ) {
+                 for ( i = 0 ; i < n ; i++ ) {
+                    if ( mask[i] ) {
+                       const int fy = Y_FLIP( y[i] );
+                       if ( CLIPPIXEL( x[i], fy ) )
+                          WRITE_DEPTH( x[i], fy, depth[i] );
+                    }
+                 }
+              }
+              else {
+                 for ( i = 0 ; i < n ; i++ ) {
                     const int fy = Y_FLIP( y[i] );
                     if ( CLIPPIXEL( x[i], fy ) )
                        WRITE_DEPTH( x[i], fy, depth[i] );
@@ -238,6 +241,22 @@ static void TAG(ReadDepthPixels)( GLcontext *ctx,
 }
 
 
+/**
+ * Initialize the given renderbuffer's span routines to point to
+ * the depth/z functions we generated above.
+ */
+static void TAG(InitDepthPointers)(struct gl_renderbuffer *rb)
+{
+   rb->GetRow = TAG(ReadDepthSpan);
+   rb->GetValues = TAG(ReadDepthPixels);
+   rb->PutRow = TAG(WriteDepthSpan);
+   rb->PutRowRGB = NULL;
+   rb->PutMonoRow = TAG(WriteMonoDepthSpan);
+   rb->PutValues = TAG(WriteDepthPixels);
+   rb->PutMonoValues = NULL;
+}
+
+
 #if HAVE_HW_DEPTH_SPANS
 #undef WRITE_DEPTH_SPAN
 #undef WRITE_DEPTH_PIXELS