panfrost: Set array_size to permit array textures
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 14 Jun 2019 23:26:49 +0000 (16:26 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Jun 2019 15:36:14 +0000 (08:36 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c

index d7591eae7b976e4b9c18620b138ae04c6f83c323..d872884077fff6f0715bd3a76ac7c667e28aa802 100644 (file)
@@ -2097,10 +2097,21 @@ panfrost_create_sampler_view(
                 }
         }
 
+        /* In the hardware, array_size refers specifically to array textures,
+         * whereas in Gallium, it also covers cubemaps */
+
+        unsigned array_size = texture->array_size;
+
+        if (texture->target == PIPE_TEXTURE_CUBE) {
+                /* TODO: Cubemap arrays */
+                assert(array_size == 6);
+        }
+
         struct mali_texture_descriptor texture_descriptor = {
                 .width = MALI_POSITIVE(texture->width0),
                 .height = MALI_POSITIVE(texture->height0),
                 .depth = MALI_POSITIVE(texture->depth0),
+                .array_size = MALI_POSITIVE(array_size),
 
                 /* TODO: Decode */
                 .format = {