freedreno: turn staging cube into 2d-array
authorRob Clark <robdclark@chromium.org>
Wed, 12 Jun 2019 20:36:18 +0000 (13:36 -0700)
committerRob Clark <robdclark@chromium.org>
Thu, 13 Jun 2019 15:56:27 +0000 (08:56 -0700)
Since we could only need a subset of the layers, and otherwise we
trigger an assert in util_max_layer()

Signed-off-by: Rob Clark <robdclark@chromium.org>
src/gallium/drivers/freedreno/freedreno_resource.c

index bcc1efe3cada4be5995d8c1db31330476567bb4c..7b1b1bf43f86284c55c65375c26c22eb77da4817 100644 (file)
@@ -353,6 +353,8 @@ fd_alloc_staging(struct fd_context *ctx, struct fd_resource *rsc,
         * for 3d textures, it is the depth:
         */
        if (tmpl.array_size > 1) {
+               if (tmpl.target == PIPE_TEXTURE_CUBE)
+                       tmpl.target = PIPE_TEXTURE_2D_ARRAY;
                tmpl.array_size = box->depth;
                tmpl.depth0 = 1;
        } else {