render: gles2: pass: Implement rendering into NV12 buffers

As mentioned in the previous commit message, we can't create an RBO out
of an NV12 buffer in GL ES2.0. Instead, we render in 2 passes to 2
separate RBOs.

This could be made more generic by having a lookup table for the
parameters that need to be set for each plane for any given format, but
as of yet, I see no practical reason for implementing any other kind of
YCbCr target buffer rendering as NV12 seems to be the only format that's
commonly supported by hardware video encoders.

Signed-off-by: Andri Yngvason <andri@yngvason.is>
This commit is contained in:
Andri Yngvason 2026-04-16 13:45:56 +00:00
parent c074f6e83f
commit 97c8d24fa4
3 changed files with 131 additions and 21 deletions

View file

@ -295,7 +295,8 @@ static struct wlr_render_pass *gles2_begin_buffer_pass(struct wlr_renderer *wlr_
}
struct wlr_gles2_render_pass *pass = begin_gles2_buffer_pass(buffer,
&prev_ctx, timer, options->signal_timeline, options->signal_point);
&prev_ctx, timer, options->signal_timeline, options->signal_point,
options->color_encoding, options->color_range);
if (!pass) {
return NULL;
}