radeon/fbo: use correct depth texture offset for depth textures
authorAndre Maasikas <amaasikas@gmail.com>
Mon, 4 Jan 2010 07:26:46 +0000 (09:26 +0200)
committerAndre Maasikas <amaasikas@gmail.com>
Fri, 22 Jan 2010 10:38:34 +0000 (12:38 +0200)
src/mesa/drivers/dri/radeon/radeon_fbo.c
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h

index 7b1f84a71548277f24413fd59d3d0df791d1e115..e780b9eef1b4fee917312c85d6e0c71e11b61cf9 100644 (file)
@@ -531,10 +531,9 @@ radeon_render_texture(GLcontext * ctx,
                                             att->TextureLevel);
 
    if (att->Texture->Target == GL_TEXTURE_3D) {
-      GLuint offsets[6];
-      radeon_miptree_depth_offsets(radeon_image->mt, att->TextureLevel,
-                                  offsets);
-      imageOffset += offsets[att->Zoffset];
+      imageOffset += radeon_image->mt->levels[att->TextureLevel].rowstride *
+                     radeon_image->mt->levels[att->TextureLevel].height *
+                     att->Zoffset;
    }
 
    /* store that offset in the region, along with the correct pitch for
index 033f26db2a1b69a7ca92c044380cdbe019aa5cd1..3a3658c31413d2a1e160136c713753ef5ade8bd3 100644 (file)
@@ -380,25 +380,6 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t)
                texImg->Depth, t->tile_bits);
 }
 
-/* Although we use the image_offset[] array to store relative offsets
- * to cube faces, Mesa doesn't know anything about this and expects
- * each cube face to be treated as a separate image.
- *
- * These functions present that view to mesa:
- */
-void
-radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets)
-{
-       if (mt->target != GL_TEXTURE_3D || mt->faces == 1) {
-               offsets[0] = 0;
-       } else {
-               int i;
-               for (i = 0; i < 6; i++) {
-                       offsets[i] = mt->levels[level].faces[i].offset;
-               }
-       }
-}
-
 GLuint
 radeon_miptree_image_offset(radeon_mipmap_tree *mt,
                            GLuint face, GLuint level)
@@ -619,4 +600,4 @@ uint32_t get_base_teximage_offset(radeonTexObj *texObj)
        } else {
                return radeon_miptree_image_offset(texObj->mt, 0, texObj->minLod);
        }
-}
\ No newline at end of file
+}
index a10649b5aeac8ee961d48b04c39f84bb62a44417..c911688c1a5d2d81f29b0d43b9b1f418b75d1898 100644 (file)
@@ -88,7 +88,5 @@ GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt,
 void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t);
 GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt,
                                   GLuint face, GLuint level);
-void radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets);
-
 uint32_t get_base_teximage_offset(radeonTexObj *texObj);
 #endif /* __RADEON_MIPMAP_TREE_H_ */