[Mesa-dev] [PATCH] freedreno: fix slice pitch calculations

Ilia Mirkin imirkin at alum.mit.edu
Thu Mar 12 22:41:15 PDT 2015


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.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable at lists.freedesktop.org>
---

Still need to run this through piglit, but the initial texelFetch
results are encouraging. There still seems to be some horrible problem
with array textures e.g. sampler2DArray 100x100x5, but it actually
feels related to rendering rather than sampling.

 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 afb396e..a49d5f5 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -213,7 +213,7 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment)
 	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;
 		if (level == 0 || layers_in_level == 1)
 			slice->size0 = align(slice->pitch * height * rsc->cpp, alignment);
-- 
2.0.5



More information about the mesa-dev mailing list