Shaders used in set_buffer_layer will apply colorspace conversion,
so we need to set correct matrix depending on the input and output
surface formats.
Use BT.601 (default) for YUV to RGB and identity for RGB to RGB.
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24626>
{
struct pipe_sampler_view **sampler_views;
unsigned i;
+ vl_csc_matrix csc_matrix;
assert(s && c && buffer);
else if (c->pipe_gfx_supported)
s->layers[layer].fs = c->fs_video_buffer;
}
+
+ vl_csc_get_matrix(util_format_is_yuv(buffer->buffer_format) ?
+ VL_CSC_COLOR_STANDARD_BT_601 :
+ VL_CSC_COLOR_STANDARD_IDENTITY,
+ NULL, true, &csc_matrix);
+ vl_compositor_set_csc_matrix(s, &csc_matrix, 1.0f, 0.0f);
}
void