util/format: 8-bit interleaved YUV formats are UNORM
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Thu, 10 Aug 2023 22:05:07 +0000 (17:05 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Aug 2023 23:44:19 +0000 (23:44 +0000)
commit9a6ec6cdd6adebbb2a6d9f14068b4253b72d4c0b
tree4291b8642986e6672fc7fa31540228f352afb541
parentc1a0bdae1ccc2c6b98d46fd2c2022ed5a6811d6b
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>
src/util/format/u_format.csv