From 08596a50d3ae8efa04a35f56e5cd549357fddd12 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sat, 4 Jan 2025 23:09:57 -0500 Subject: [PATCH] video/out/gpu/video: allow taking transparent screenshots Use RGBA format to take transparent screenshots when the video has an alpha channel. --- video/out/gpu/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 0486cc4341019..871794d3daafc 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -3586,7 +3586,7 @@ void gl_video_screenshot(struct gl_video *p, struct vo_frame *frame, }; params.format = ra_find_unorm_format(p->ra, 1, 4); - int mpfmt = IMGFMT_RGB0; + int mpfmt = p->has_alpha ? IMGFMT_RGBA : IMGFMT_RGB0; if (args->high_bit_depth && p->ra_format.component_bits > 8) { const struct ra_format *fmt = ra_find_unorm_format(p->ra, 2, 4); if (fmt && fmt->renderable) {