radeon: revert unneeded change to texturing code
authorDave Airlie <airlied@redhat.com>
Fri, 13 Feb 2009 13:02:12 +0000 (23:02 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 13 Feb 2009 13:02:12 +0000 (23:02 +1000)
src/mesa/drivers/dri/radeon/radeon_texture.c

index eb87a0dac5d64e9683192b6fa2023bf1ec6f76ba..2b04245a39a46de26a33f437895463755a89f1e4 100644 (file)
@@ -511,11 +511,8 @@ static void radeon_teximage(
                int size;
                if (texImage->IsCompressed) {
                        size = texImage->CompressedSize;
-                       dstRowStride =
-                         _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width);
                } else {
                        size = texImage->Width * texImage->Height * texImage->Depth * texImage->TexFormat->TexelBytes;
-                       dstRowStride = postConvWidth * texelBytes;
                }
                texImage->Data = _mesa_alloc_texmemory(size);
        }
@@ -536,6 +533,14 @@ static void radeon_teximage(
                if (compressed) {
                        memcpy(texImage->Data, pixels, imageSize);
                } else {
+                       GLuint dstRowStride;
+                       if (image->mt) {
+                               radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel];
+                               dstRowStride = lvl->rowstride;
+                       } else {
+                               dstRowStride = texImage->Width * texImage->TexFormat->TexelBytes;
+                       }
+
                        if (!texImage->TexFormat->StoreImage(ctx, dims,
                                                texImage->_BaseFormat,
                                                texImage->TexFormat,