util/format: 8-bit interleaved YUV formats are UNORM

Without this, gallivm doesn't know what to do with the result data of a
texture fetch.  We have a bunch of gallivm code to handle these but, as
far as I can tell, none of it works properly without channel types.  The
YUYV texturing helpers all consume a 32-bit packed value, unpack it,
shuffle things as needed, and then re-pack into a 32-bit RGBA value,
trusting later code to unpack that as 8-bit UNORM.  For the raw formats,
this unpacking never happens.

What saves us is that I also don't think any of this code is ever used.
LLVMpipe supports the actual YUYV formats and we don't use the gallium
lowering pass which lowers to the raw formats.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
This commit is contained in:
Faith Ekstrand 2023-08-10 17:05:07 -05:00 committed by Marge Bot
parent c1a0bdae1c
commit 9a6ec6cdd6

View file

@ -186,12 +186,12 @@ PIPE_FORMAT_AYUV , other, 4, 4, 1, un8 , , , , xy
PIPE_FORMAT_XYUV , other, 4, 4, 1, un8 , , , , xyz1, yuv
# same subsampling but with rgb channels
PIPE_FORMAT_R8G8_B8G8_UNORM , subsampled, 2, 1, 1, x32 , , , , xyz1, rgb
PIPE_FORMAT_G8R8_G8B8_UNORM , subsampled, 2, 1, 1, x32 , , , , xyz1, rgb
PIPE_FORMAT_G8R8_B8R8_UNORM , subsampled, 2, 1, 1, x32 , , , , zyx1, rgb
PIPE_FORMAT_R8G8_R8B8_UNORM , subsampled, 2, 1, 1, x32 , , , , zyx1, rgb
PIPE_FORMAT_B8R8_G8R8_UNORM , subsampled, 2, 1, 1, x32 , , , , yxz1, rgb
PIPE_FORMAT_R8B8_R8G8_UNORM , subsampled, 2, 1, 1, x32 , , , , yxz1, rgb
PIPE_FORMAT_R8G8_B8G8_UNORM , subsampled, 2, 1, 1, un8 , un8 , un8 , un8 , xyz1, rgb
PIPE_FORMAT_G8R8_G8B8_UNORM , subsampled, 2, 1, 1, un8 , un8 , un8 , un8 , xyz1, rgb
PIPE_FORMAT_G8R8_B8R8_UNORM , subsampled, 2, 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb
PIPE_FORMAT_R8G8_R8B8_UNORM , subsampled, 2, 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb
PIPE_FORMAT_B8R8_G8R8_UNORM , subsampled, 2, 1, 1, un8 , un8 , un8 , un8 , yxz1, rgb
PIPE_FORMAT_R8B8_R8G8_UNORM , subsampled, 2, 1, 1, un8 , un8 , un8 , un8 , yxz1, rgb
# some special formats not fitting anywhere else
PIPE_FORMAT_R11G11B10_FLOAT , other, 1, 1, 1, f11 , f11 , f10 , , xyz1, rgb

Can't render this file because it contains an unexpected character in line 8 and column 3.