i965: Fix tiling for FBO depth attachments by making DEPTH_COMPONENT Y tiled.
authorEric Anholt <eric@anholt.net>
Fri, 12 Jun 2009 15:44:40 +0000 (08:44 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 18 Jun 2009 03:19:19 +0000 (20:19 -0700)
This may hurt if miptree relayout occurs, since we can't blit Y tiled
objects.  But it corrects depth tests on FBOs using textures.

src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_regions.c

index 0d34f28311e10d3abd959aff2bca72b756f360d2..fcfed9e751d35e758a34b451073c207fb8a59fc6 100644 (file)
@@ -113,9 +113,13 @@ intel_miptree_create(struct intel_context *intel,
    uint32_t tiling;
 
    if (intel->use_texture_tiling && compress_byte == 0 &&
-       intel->intelScreen->kernel_exec_fencing)
-      tiling = I915_TILING_X;
-   else
+       intel->intelScreen->kernel_exec_fencing) {
+      if (IS_965(intel->intelScreen->deviceID) &&
+         internal_format == GL_DEPTH_COMPONENT)
+        tiling = I915_TILING_Y;
+      else
+        tiling = I915_TILING_X;
+   } else
       tiling = I915_TILING_NONE;
 
    mt = intel_miptree_create_internal(intel, target, internal_format,
index 49bcb3c1ddd04f91f48471dbaf28512f020d1ecc..7c3b4838366bb2992a796d6e9362171e80389362 100644 (file)
@@ -189,7 +189,7 @@ intel_region_alloc(struct intel_context *intel,
                                        pitch, buffer);
 
    if (tiling != I915_TILING_NONE) {
-      assert(((pitch * cpp) & 511) == 0);
+      assert(((pitch * cpp) & 127) == 0);
       drm_intel_bo_set_tiling(buffer, &tiling, pitch * cpp);
       drm_intel_bo_get_tiling(buffer, &region->tiling, &region->bit_6_swizzle);
    }