nir: add common convert_ycbcr for vulkan csc

Copied from anv, replaced state with passing model/range directly.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: D Scott Phillips <d.scott.phillips@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4528>
This commit is contained in:
Jonathan Marek
2020-04-10 08:34:53 -04:00
committed by Marge Bot
parent c2d8a4bf17
commit f8558fb1ce
4 changed files with 158 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: MIT */
#include "nir.h"
#include "nir_builder.h"
#include "vulkan/vulkan_core.h"
nir_ssa_def *
nir_convert_ycbcr_to_rgb(nir_builder *b,
VkSamplerYcbcrModelConversion model,
VkSamplerYcbcrRange range,
nir_ssa_def *raw_channels,
uint32_t *bpcs);