r300g: properly setup textures from X server
authorMarek Olšák <maraeo@gmail.com>
Sat, 3 Apr 2010 15:08:45 +0000 (17:08 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sun, 4 Apr 2010 00:46:12 +0000 (02:46 +0200)
The setup needs be done after querying tiling flags.

src/gallium/drivers/r300/r300_texture.c

index a9c9e14ba7cf275856c7f3dd0ff1998c63a98ad5..72e14bd8922d121621a3e13ac9c5f58b5b2044ab 100644 (file)
@@ -901,15 +901,14 @@ static struct pipe_texture*
     tex->tex.screen = screen;
 
     tex->stride_override = stride;
-    tex->pitch[0] = stride / util_format_get_blocksize(base->format);
-
-    r300_setup_flags(tex);
-    r300_setup_texture_state(rscreen, tex);
 
     /* one ref already taken */
     tex->buffer = buffer;
 
     rws->buffer_get_tiling(rws, buffer, &tex->microtile, &tex->macrotile);
+    r300_setup_flags(tex);
+    r300_setup_miptree(rscreen, tex);
+    r300_setup_texture_state(rscreen, tex);
     return (struct pipe_texture*)tex;
 }