radeon: fix r100/r200 compressed texture stride
authorRoland Scheidegger <sroland@vmware.com>
Fri, 31 Jul 2009 21:24:44 +0000 (23:24 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 31 Jul 2009 21:24:44 +0000 (23:24 +0200)
This almost fixes compressed mipmapped textures on r200, though some small
mip levels are still broken.
Leave r300 compressed texture stride as is though afaik it's different
to pre-radeon-rewrite too. Also do the fixup for rs600 uncompressed row stride
at same place.

src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/radeon/radeon_common_context.c

index 6f3aab986d236269f06a2c8ef3a5f57d342b1ef8..db404b384796388c3e1cf1c1d0f43a9b063de4cb 100644 (file)
@@ -451,11 +451,6 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        r300InitState(r300);
        r300InitShaderFunctions(r300);
 
-       if (screen->chip_family == CHIP_FAMILY_RS600 || screen->chip_family == CHIP_FAMILY_RS690 ||
-               screen->chip_family == CHIP_FAMILY_RS740) {
-               r300->radeon.texture_row_align = 64;
-       }
-
        r300InitGLExtensions(ctx);
 
        return GL_TRUE;
index 4e4eba5d94c28f10e0bf8716bb470b760592f635..2a017b59cfcc4fc124d35f4105b4bab7e972d51f 100644 (file)
@@ -245,9 +245,20 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
                radeon->texture_row_align = 256;
                radeon->texture_rect_row_align = 256;
                radeon->texture_compressed_row_align = 256;
-       } else {
+       } else if (IS_R200_CLASS(radeon->radeonScreen) ||
+                  IS_R100_CLASS(radeon->radeonScreen)) {
                radeon->texture_row_align = 32;
                radeon->texture_rect_row_align = 64;
+               radeon->texture_compressed_row_align = 32;
+       } else { /* R300 - not sure this is all correct */
+               int chip_family = radeon->radeonScreen->chip_family;
+               if (chip_family == CHIP_FAMILY_RS600 ||
+                   chip_family == CHIP_FAMILY_RS690 ||
+                   chip_family == CHIP_FAMILY_RS740)
+                       radeon->texture_row_align = 64;
+               else
+                       radeon->texture_row_align = 32;
+               radeon->texture_rect_row_align = 64;
                radeon->texture_compressed_row_align = 64;
        }