aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Dänzer2012-09-05 11:44:45 -0500
committerMichel Dänzer2012-09-06 08:25:13 -0500
commitb925022a3e4616665b388a78abab4e3270b4b4ec (patch)
tree0991f43f60aadbfe30bab1bfb8604f7073546ea5
parent45083e6d36125c64267c917da3d81e1e144ed33d (diff)
downloadlibdrm-b925022a3e4616665b388a78abab4e3270b4b4ec.tar.gz
libdrm-b925022a3e4616665b388a78abab4e3270b4b4ec.tar.xz
libdrm-b925022a3e4616665b388a78abab4e3270b4b4ec.zip
radeon: Sampling pitch for non-mipmaps seems padded to slice alignment on SI.
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>
-rw-r--r--radeon/radeon_surface.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index 98faa0b9..80b15056 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -974,10 +974,15 @@ static void si_surf_minify_linear_aligned(struct radeon_surface *surf,
974 surf->level[level].nblk_z = (surf->level[level].npix_z + surf->blk_d - 1) / surf->blk_d; 974 surf->level[level].nblk_z = (surf->level[level].npix_z + surf->blk_d - 1) / surf->blk_d;
975 } 975 }
976 976
977 /* XXX: Second smallest level uses larger pitch, not sure of the real reason, 977 /* XXX: Texture sampling uses unexpectedly large pitches in some cases,
978 * my best guess so far: rows evenly distributed across slice 978 * these are just guesses for the rules behind those
979 */ 979 */
980 xalign = MAX2(xalign, slice_align / surf->bpe / surf->level[level].npix_y); 980 if (level == 0 && surf->last_level == 0)
981 /* Non-mipmap pitch padded to slice alignment */
982 xalign = MAX2(xalign, slice_align / surf->bpe);
983 else
984 /* Small rows evenly distributed across slice */
985 xalign = MAX2(xalign, slice_align / surf->bpe / surf->level[level].npix_y);
981 986
982 surf->level[level].nblk_x = ALIGN(surf->level[level].nblk_x, xalign); 987 surf->level[level].nblk_x = ALIGN(surf->level[level].nblk_x, xalign);
983 surf->level[level].nblk_y = ALIGN(surf->level[level].nblk_y, yalign); 988 surf->level[level].nblk_y = ALIGN(surf->level[level].nblk_y, yalign);