Mesa (10.5): freedreno/a3xx: use the same layer size for all slices

Emil Velikov evelikov at kemper.freedesktop.org
Thu Mar 26 01:44:45 UTC 2015


Module: Mesa
Branch: 10.5
Commit: 3fa76f3f79962c608f2adbdad2bd942006683690
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3fa76f3f79962c608f2adbdad2bd942006683690

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Mar 13 00:53:49 2015 -0400

freedreno/a3xx: use the same layer size for all slices

We only program in one layer size per texture, so that means that all
levels must share one size. This makes the piglit test

bin/texelFetch fs sampler2DArray

have the same breakage as its non-array version instead of being
completely off, and makes

bin/ext_texture_array-gen-mipmap

start passing.

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 89b26d5a360ebde11a69f2cdefa66e4d6a2a13fd)

---

 src/gallium/drivers/freedreno/freedreno_resource.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index c412407..c7b4e57 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -215,7 +215,14 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment)
 
 		slice->pitch = align(width, 32);
 		slice->offset = size;
-		slice->size0 = align(slice->pitch * height * rsc->cpp, alignment);
+		/* 1d array, 2d array, 3d textures (but not cube!) must all have the
+		 * same layer size for each miplevel on a3xx. These are also the
+		 * targets that have non-1 alignment.
+		 */
+		if (level == 0 || layers_in_level == 1 || alignment == 1)
+			slice->size0 = align(slice->pitch * height * rsc->cpp, alignment);
+		else
+			slice->size0 = rsc->slices[0].size0;
 
 		size += slice->size0 * depth * layers_in_level;
 




More information about the mesa-commit mailing list