Mesa (master): freedreno/a6xx: simplify special case for 3d layout

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 22 20:32:08 UTC 2018


Module: Mesa
Branch: master
Commit: 2b497fc507af7c048efb52e38e800396bce67fca
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b497fc507af7c048efb52e38e800396bce67fca

Author: Rob Clark <robdclark at gmail.com>
Date:   Tue Dec 18 10:28:57 2018 -0500

freedreno/a6xx: simplify special case for 3d layout

This logic can be re-written as the two cases for 3d (ie. before/after
the miplevel sizes start reducing) vs everything else.  I think it is
easier to read this way.

Signed-off-by: Rob Clark <robdclark at gmail.com>

---

 src/gallium/drivers/freedreno/a6xx/fd6_resource.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
index 6f1b745047..2b695e6969 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
@@ -42,7 +42,7 @@ static const struct {
 };
 
 /* NOTE: good way to test this is:  (for example)
- *  piglit/bin/texelFetch fs sampler2D 100x100x1-100x300x1
+ *  piglit/bin/texelFetch fs sampler3D 100x100x8
  */
 static uint32_t
 setup_slices(struct fd_resource *rsc, uint32_t alignment, enum pipe_format format)
@@ -96,19 +96,20 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment, enum pipe_format forma
 		blocks = util_format_get_nblocks(format, slice->pitch, aligned_height);
 
 		/* 1d array and 2d array textures must all have the same layer size
-		 * for each miplevel on a3xx. 3d textures can have different layer
+		 * for each miplevel on a6xx. 3d textures can have different layer
 		 * sizes for high levels, but the hw auto-sizer is buggy (or at least
 		 * different than what this code does), so as soon as the layer size
 		 * range gets into range, we stop reducing it.
 		 */
-		if (prsc->target == PIPE_TEXTURE_3D && (
-					level == 1 ||
-					(level > 1 && rsc->slices[level - 1].size0 > 0xf000)))
-			slice->size0 = align(blocks * rsc->cpp, alignment);
-		else if (level == 0 || rsc->layer_first || alignment == 1)
+		if (prsc->target == PIPE_TEXTURE_3D) {
+			if (level <= 1 || (rsc->slices[level - 1].size0 > 0xf000)) {
+				slice->size0 = align(blocks * rsc->cpp, alignment);
+			} else {
+				slice->size0 = rsc->slices[level - 1].size0;
+			}
+		} else {
 			slice->size0 = align(blocks * rsc->cpp, alignment);
-		else
-			slice->size0 = rsc->slices[level - 1].size0;
+		}
 
 #if 0
 		debug_printf("%s: %ux%ux%u@%u: %2u: stride=%4u, size=%7u, aligned_height=%3u\n",




More information about the mesa-commit mailing list