intel: Add span code for z24 without stencil.
authorEric Anholt <eric@anholt.net>
Thu, 26 Feb 2009 07:58:38 +0000 (23:58 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 26 Feb 2009 08:13:26 +0000 (00:13 -0800)
It seems that in this case the Mesa code is handing us x8z24 values instead
of z24s8 values, so we need to not do the rotation.  Fixes half of OGLconform
depthrange.c.

Bug #19447.

src/mesa/drivers/dri/intel/intel_span.c

index b397fbebce2d78eb0994339005cd92f8d43c552a..c3a873f1abdc42e299c0ce46ec1aac1b7fd9cb89 100644 (file)
@@ -349,6 +349,13 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
 #define INTEL_TAG(name) name##_z16
 #include "intel_depthtmp.h"
 
+/* z24 depthbuffer functions. */
+#define INTEL_VALUE_TYPE GLuint
+#define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, d)
+#define INTEL_READ_DEPTH(offset) pread_32(irb, offset)
+#define INTEL_TAG(name) name##_z24
+#include "intel_depthtmp.h"
+
 /* z24s8 depthbuffer functions. */
 #define INTEL_VALUE_TYPE GLuint
 #define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, z24s8_to_s8z24(d))
@@ -613,8 +620,21 @@ intel_set_span_functions(struct intel_context *intel,
         break;
       }
    }
-   else if (rb->_ActualFormat == GL_DEPTH_COMPONENT24 ||        /* XXX FBO remove */
-            rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) {
+   else if (rb->_ActualFormat == GL_DEPTH_COMPONENT24) {
+      switch (tiling) {
+      case I915_TILING_NONE:
+      default:
+        intelInitDepthPointers_z24(rb);
+        break;
+      case I915_TILING_X:
+        intel_XTile_InitDepthPointers_z24(rb);
+        break;
+      case I915_TILING_Y:
+        intel_YTile_InitDepthPointers_z24(rb);
+        break;
+      }
+   }
+   else if (rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) {
       switch (tiling) {
       case I915_TILING_NONE:
       default: