summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 45083e6)
raw | patch | inline | side by side (parent: 45083e6)
author | Michel Dänzer <michel.daenzer@amd.com> | |
Wed, 5 Sep 2012 16:44:45 +0000 (18:44 +0200) | ||
committer | Michel Dänzer <michel@daenzer.net> | |
Thu, 6 Sep 2012 13:25:13 +0000 (15:25 +0200) |
Another corner case that isn't well-explained yet.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
radeon/radeon_surface.c | patch | blob | history |
index 98faa0b98c25cbaae65a78a312a363b81d1a23b6..80b15056c91267f64807cab907858b4f34e2c389 100644 (file)
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
surf->level[level].nblk_z = (surf->level[level].npix_z + surf->blk_d - 1) / surf->blk_d;
}
- /* XXX: Second smallest level uses larger pitch, not sure of the real reason,
- * my best guess so far: rows evenly distributed across slice
+ /* XXX: Texture sampling uses unexpectedly large pitches in some cases,
+ * these are just guesses for the rules behind those
*/
- xalign = MAX2(xalign, slice_align / surf->bpe / surf->level[level].npix_y);
+ if (level == 0 && surf->last_level == 0)
+ /* Non-mipmap pitch padded to slice alignment */
+ xalign = MAX2(xalign, slice_align / surf->bpe);
+ else
+ /* Small rows evenly distributed across slice */
+ xalign = MAX2(xalign, slice_align / surf->bpe / surf->level[level].npix_y);
surf->level[level].nblk_x = ALIGN(surf->level[level].nblk_x, xalign);
surf->level[level].nblk_y = ALIGN(surf->level[level].nblk_y, yalign);