panfrost: Don't double-compose swizzles
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 27 Oct 2020 18:21:44 +0000 (14:21 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sat, 31 Oct 2020 14:09:18 +0000 (14:09 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: b9a136cdd1e ("panfrost: Implement BGRA textures")
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7352>

src/gallium/drivers/panfrost/pan_context.c

index 3ff1d75..0eb1863 100644 (file)
@@ -1015,9 +1015,6 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                 panfrost_translate_texture_dimension(so->base.target);
 
         if (device->quirks & IS_BIFROST) {
-                unsigned char composed_swizzle[4];
-                util_format_compose_swizzles(desc->swizzle, user_swizzle, composed_swizzle);
-
                 unsigned size = panfrost_estimate_texture_payload_size(
                                 so->base.u.tex.first_level,
                                 so->base.u.tex.last_level,
@@ -1041,7 +1038,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                                 so->base.u.tex.last_layer,
                                 texture->nr_samples,
                                 prsrc->cubemap_stride,
-                                panfrost_translate_swizzle_4(composed_swizzle),
+                                panfrost_translate_swizzle_4(user_swizzle),
                                 prsrc->bo->ptr.gpu,
                                 prsrc->slices, &so->bo->ptr);
         } else {