From 67fc71214dbfdc0fb6d06b3ffbe14ac35021bfd6 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 18 May 2022 13:32:35 +0100 Subject: [PATCH] gl-renderer: Add comment for yuv_format_descriptor Try to describe this and yuv_plane_descriptor as well, since they're not blindingly obvious. Signed-off-by: Daniel Stone --- libweston/renderer-gl/gl-renderer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 2ca9961c..53072216 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -118,6 +118,16 @@ struct dmabuf_format { int num_modifiers; }; +/* + * yuv_format_descriptor and yuv_plane_descriptor describe the translation + * between YUV and RGB formats. When native YUV sampling is not available, we + * bind each YUV plane as one or more RGB plane and convert in the shader. + * This structure describes the mapping: output_planes is the number of + * RGB images we need to bind, each of which has a yuv_plane_descriptor + * describing the GL format and the input (YUV) plane index to bind. + * + * The specified shader_variant is then used to sample. + */ struct yuv_plane_descriptor { uint32_t format; int plane_index;