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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
This commit is contained in:
Connor Abbott 2023-09-01 14:20:19 +02:00 committed by Marge Bot
parent 08581e2e92
commit 60b1b18eb9
2 changed files with 5 additions and 5 deletions

View file

@ -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),

View file

@ -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;