gallium/st: lower NV21 to R8_B8G8 instead of G8_B8R8
authorItalo Nicola <italonicola@collabora.com>
Mon, 10 Jul 2023 23:09:44 +0000 (23:09 +0000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 11 Aug 2023 18:43:38 +0000 (18:43 +0000)
commit2dc883eb37f04eb0bfbbb3cda62687a18b9235de
treeb8efe971358ebda83b50af30130b8d262a66ecda
parent4eb0a98e5a45572a6c30f16f7b7e21cf22d158c2
gallium/st: lower NV21 to R8_B8G8 instead of G8_B8R8

When NV21 lowering with hardware sampling and shader CSC was added, the
incorrect PIPE_FORMAT_G8_B8R8_UNORM was used. That format is supposed to
represent vulkan NV12 instead.

This commit introduces PIPE_FORMAT_R8_B8G8_UNORM, which correctly describes the
gallium mapping for YUV CSC, with R as Y, instead of G as Y.

Fixes: 26e3be513dc ("gallium/st: add support for PIPE_FORMAT_NV21 and PIPE_FORMAT_G8_B8R8_420")
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/panfrost/lib/pan_format.c
src/util/format/u_format.csv
src/util/format/u_format_table.py
src/util/format/u_formats.h