Mesa (10.4): freedreno: fix slice pitch calculations

Emil Velikov evelikov at kemper.freedesktop.org
Thu Mar 19 00:33:00 UTC 2015


Module: Mesa
Branch: 10.4
Commit: a563045009fe01689553c6e3db2b030cd074ce8a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a563045009fe01689553c6e3db2b030cd074ce8a

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Mar 13 01:36:57 2015 -0400

freedreno: fix slice pitch calculations

For example if width were 65, the first slice would get 96 while the
second would get 32. However the hardware appears to expect the second
pitch to be 64, based on halving the 96 (and aligning up to 32).

This fixes texelFetch piglit tests on a3xx below a certain size. Going
higher they break again, but most likely due to unrelated reasons.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Rob Clark <robclark at freedesktop.org>
(cherry picked from commit 620e29b74821fd75b24495ab2bfddea53fc75350)

---

 src/gallium/drivers/freedreno/freedreno_resource.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index 6b31d26..e9ec913 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -199,7 +199,7 @@ setup_slices(struct fd_resource *rsc)
 	for (level = 0; level <= prsc->last_level; level++) {
 		struct fd_resource_slice *slice = fd_resource_slice(rsc, level);
 
-		slice->pitch = align(width, 32);
+		slice->pitch = width = align(width, 32);
 		slice->offset = size;
 		slice->size0 = slice->pitch * height * rsc->cpp;
 




More information about the mesa-commit mailing list