From: Faith Ekstrand Date: Thu, 10 Aug 2023 22:05:07 +0000 (-0500) Subject: util/format: 8-bit interleaved YUV formats are UNORM X-Git-Tag: upstream/23.3.3~3318 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a6ec6cdd6adebbb2a6d9f14068b4253b72d4c0b;p=platform%2Fupstream%2Fmesa.git 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 Reviewed-by: Roland Scheidegger Part-of: --- diff --git a/src/util/format/u_format.csv b/src/util/format/u_format.csv index fca8110..c47ec0c 100644 --- a/src/util/format/u_format.csv +++ b/src/util/format/u_format.csv @@ -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