freedreno/a6xx: Disable the core layer-size setup.
authorEric Anholt <eric@anholt.net>
Thu, 12 Dec 2019 00:30:43 +0000 (16:30 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 4 Feb 2020 23:18:00 +0000 (23:18 +0000)
This was getting in the way of UBWC mipmap handling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3059>

src/gallium/drivers/freedreno/a6xx/fd6_resource.c
src/gallium/drivers/freedreno/freedreno_resource.c

index 04753f9e0dc958b78b87dd905bd4260e6d1b15c1..954024cfb12322fc5341e8d17446c886e1336d31 100644 (file)
@@ -202,9 +202,5 @@ fd6_setup_slices(struct fd_resource *rsc)
                        prsc->last_level + 1, prsc->array_size,
                        prsc->target == PIPE_TEXTURE_3D, false);
 
-       /* The caller does this bit of layout setup again. */
-       if (rsc->layout.layer_first)
-               return rsc->layout.size / prsc->array_size;
-       else
-               return rsc->layout.size;
+       return rsc->layout.size;
 }
index 77b6cb5b6ca039b495053260ab3053d91ea3886a..0f48e5878ffa315a3e2c763e6da74a87dacabdb0 100644 (file)
@@ -998,7 +998,8 @@ fd_resource_create_with_modifiers(struct pipe_screen *pscreen,
                return prsc;
        }
 
-       if (rsc->layout.layer_first) {
+       /* Set the layer size if the (non-a6xx) backend hasn't done so. */
+       if (rsc->layout.layer_first && !rsc->layout.layer_size) {
                rsc->layout.layer_size = align(size, 4096);
                size = rsc->layout.layer_size * prsc->array_size;
        }