From 60b1b18eb9ad437ba48f55d37dbb9901d4102f21 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Fri, 1 Sep 2023 14:20:19 +0200 Subject: [PATCH] freedreno/fdl: Use A8_UNORM HW format for sampling We've already been using this for 3d blits on turnip and it works fine. There's no need to emulate it, and it won't work on turnip where we can't swizzle the border colors. Part-of: --- src/freedreno/fdl/fd6_format_table.c | 2 +- src/freedreno/fdl/fd6_view.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/freedreno/fdl/fd6_format_table.c b/src/freedreno/fdl/fd6_format_table.c index e80d48e..0e6b802 100644 --- a/src/freedreno/fdl/fd6_format_table.c +++ b/src/freedreno/fdl/fd6_format_table.c @@ -68,7 +68,7 @@ static const struct fd6_format formats[PIPE_FORMAT_COUNT] = { _TC(R8_SRGB, 8_UNORM, WZYX), _TC(Y8_UNORM, NV12_Y, WZYX), - FMT(A8_UNORM, NONE, 8_UNORM, A8_UNORM, WZYX), + _TC(A8_UNORM, A8_UNORM, WZYX), _TC(L8_UNORM, 8_UNORM, WZYX), _TC(L8_SRGB, 8_UNORM, WZYX), _TC(L8_SNORM, 8_SNORM, WZYX), diff --git a/src/freedreno/fdl/fd6_view.c b/src/freedreno/fdl/fd6_view.c index 8976b88..1e25fea 100644 --- a/src/freedreno/fdl/fd6_view.c +++ b/src/freedreno/fdl/fd6_view.c @@ -109,11 +109,11 @@ fdl6_format_swiz(enum pipe_format format, bool has_z24uint_s8uint, break; default: - /* Our I, L, A, and LA formats use R or RG HW formats. These aren't - * supported in Vulkan, and freedreno uses a hack to get the border - * colors correct by undoing these swizzles. + /* Our I, L, A, and LA formats use R or RG HW formats except for + * A8_UNORM. These aren't supported in Vulkan, and freedreno uses a hack + * to get the border colors correct by undoing these swizzles. */ - if (util_format_is_alpha(format)) { + if (util_format_is_alpha(format) && format != PIPE_FORMAT_A8_UNORM) { format_swiz[0] = PIPE_SWIZZLE_0; format_swiz[1] = PIPE_SWIZZLE_0; format_swiz[2] = PIPE_SWIZZLE_0; -- 2.7.4