i965: Fix depth-texture Y-tiling detection for sized internal formats.
authorEric Anholt <eric@anholt.net>
Mon, 22 Jun 2009 23:23:56 +0000 (16:23 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 24 Jun 2009 02:31:12 +0000 (19:31 -0700)
Fixes assertion failure on norsetto shadow mapping demo.

src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.h
src/mesa/drivers/dri/intel/intel_tex_image.c
src/mesa/drivers/dri/intel/intel_tex_validate.c

index 1ef2fe86d1fcfc6521966ed99df4ba43816c1d45..a0d8f0c27af11f93aab40062cd9903fd06c5f641 100644 (file)
@@ -101,6 +101,7 @@ intel_miptree_create_internal(struct intel_context *intel,
 struct intel_mipmap_tree *
 intel_miptree_create(struct intel_context *intel,
                     GLenum target,
+                    GLenum base_format,
                     GLenum internal_format,
                     GLuint first_level,
                     GLuint last_level,
@@ -115,8 +116,8 @@ intel_miptree_create(struct intel_context *intel,
    if (intel->use_texture_tiling && compress_byte == 0 &&
        intel->intelScreen->kernel_exec_fencing) {
       if (IS_965(intel->intelScreen->deviceID) &&
-         (internal_format == GL_DEPTH_COMPONENT ||
-          internal_format == GL_DEPTH_STENCIL_EXT))
+         (base_format == GL_DEPTH_COMPONENT ||
+          base_format == GL_DEPTH_STENCIL_EXT))
         tiling = I915_TILING_Y;
       else
         tiling = I915_TILING_X;
index 3af9966827f40edda7d06417234091627842b59d..2a809cfda5354061a727299c0637d4117b63bc00 100644 (file)
@@ -126,6 +126,7 @@ struct intel_mipmap_tree
 
 struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
                                                GLenum target,
+                                               GLenum base_format,
                                                GLenum internal_format,
                                                GLuint first_level,
                                                GLuint last_level,
index ab9541359d29070a673b52f10617af1aa401fa4a..c5f52208376e98a8ad2d5bc04ef1a4cb9bc86631 100644 (file)
@@ -131,6 +131,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
       comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
    intelObj->mt = intel_miptree_create(intel,
                                        intelObj->base.Target,
+                                       intelImage->base._BaseFormat,
                                        intelImage->base.InternalFormat,
                                        firstLevel,
                                        lastLevel,
@@ -412,7 +413,9 @@ intelTexImage(GLcontext * ctx,
        * a miptree, so create one just for our level and store it in the image.
        * It'll get moved into the object miptree at validate time.
        */
-      intelImage->mt = intel_miptree_create(intel, target, internalFormat,
+      intelImage->mt = intel_miptree_create(intel, target,
+                                           intelImage->base.TexFormat->BaseFormat,
+                                           internalFormat,
                                            level, level,
                                            width, height, depth,
                                            intelImage->base.TexFormat->TexelBytes,
index b5cb7597d164c684f4a298c71f9158265df27734..a284d5475f4bce9227fa5844954e8b46b2b88406 100644 (file)
@@ -199,6 +199,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
    if (!intelObj->mt) {
       intelObj->mt = intel_miptree_create(intel,
                                           intelObj->base.Target,
+                                          firstImage->base._BaseFormat,
                                           firstImage->base.InternalFormat,
                                           intelObj->firstLevel,
                                           intelObj->lastLevel,