gallium/st: add non-CSC lowering of I420 as PIPE_FORMAT_R8_G8_B8_420
authorItalo Nicola <italonicola@collabora.com>
Fri, 21 Jul 2023 00:27:48 +0000 (00:27 +0000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 11 Aug 2023 18:43:38 +0000 (18:43 +0000)
commit60ebef430a5a40398f2b227b6374bc26bd10c042
treef6f8e7ef7429722365f2305349b230e4fac92533
parent06495f11daea3daff33d9e08eaf10414ad1df01e
gallium/st: add non-CSC lowering of I420 as PIPE_FORMAT_R8_G8_B8_420

This new format is similar to PIPE_FORMAT_G8_B8_R8_420, but with R as Y, G as U
and B as V. The need for two diferent formats here is because gallium maps the
YUV channels differently from vulkan.

Some hardware, e.g. Mali GPUs, can sample from I420 but need CSC in shader,
this patch implements that.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24266>
src/gallium/frontends/dri/dri2.c
src/mesa/state_tracker/st_atom_sampler.c
src/mesa/state_tracker/st_atom_texture.c
src/mesa/state_tracker/st_cb_eglimage.c
src/mesa/state_tracker/st_program.h
src/mesa/state_tracker/st_sampler_view.c
src/util/format/u_format.csv
src/util/format/u_format_table.py
src/util/format/u_formats.h