panfrost: do not handle NONE-swizzle

Neigher PIPE_SWIZZLE_NONE nor PIPE_SWIZZLE_MAX are legal here, so let's
not even try to handle it. If we ever get either here, we're triggering
a bug anyway.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26192>
This commit is contained in:
Erik Faye-Lund
2023-11-14 15:19:42 +01:00
committed by Marge Bot
parent e233eee492
commit a5970c1a01

View File

@@ -35,9 +35,8 @@ panfrost_translate_swizzle_4(const unsigned char swizzle[4])
unsigned out = 0;
for (unsigned i = 0; i < 4; ++i) {
unsigned translated =
(swizzle[i] > PIPE_SWIZZLE_1) ? PIPE_SWIZZLE_0 : swizzle[i];
out |= (translated << (3 * i));
assert(swizzle[i] <= PIPE_SWIZZLE_1);
out |= (swizzle[i] << (3 * i));
}
return out;