nir: Account for YUV range.
authorAndres Calderon Jaramillo <andrescj@chromium.org>
Sat, 21 May 2022 23:25:02 +0000 (23:25 +0000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Jun 2022 17:25:44 +0000 (17:25 +0000)
commita5d09d7a0ac73ec1626be139a482f901c521a466
tree5261d0aa48920ceed5c69b9a47402feb41ccb00e
parent676acfe956be79adafb7552829948b8875b86c8d
nir: Account for YUV range.

This patch expands on what commit
d8fdb8dab4658de2d255718627ee671e84fedf2d did. It adds support for
YUV-to-RGB conversions depending on the range of the YUV samples.

The conversion matrices and offsets are derived from
https://gist.github.com/yohhoy/dafa5a47dade85d8b40625261af3776a.

Tested-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16651>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_tex.c