From 6b9b032d517763262d416a54dcfe35a15c9c6cb1 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 26 Sep 2022 21:14:34 +0200 Subject: vo_gpu_next: update render_info for upstream API change This fixes an issue where blend stages with multiple passes got overwritten by later passes, with only the final pass (typically the overlayp pass) actually being shown. --- video/out/vo_gpu_next.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'video/out') diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index ba9f56555b..95c1987a7c 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -731,23 +731,26 @@ static void info_callback(void *priv, const struct pl_render_info *info) { struct vo *vo = priv; struct priv *p = vo->priv; + if (info->index > VO_PASS_PERF_MAX) + return; // silently ignore clipped passes, whatever - int index; struct mp_frame_perf *frame; switch (info->stage) { - case PL_RENDER_STAGE_FRAME: - if (info->index > VO_PASS_PERF_MAX) - return; // silently ignore clipped passes, whatever - frame = &p->perf.fresh; - index = info->index; - break; - case PL_RENDER_STAGE_BLEND: - frame = &p->perf.redraw; - index = 0; // ignore blended frame count - break; + case PL_RENDER_STAGE_FRAME: frame = &p->perf.fresh; break; + case PL_RENDER_STAGE_BLEND: frame = &p->perf.redraw; break; default: abort(); } + int index = info->index; +#if PL_API_VER < 227 + // Versions of libplacebo older than this used `index` to communicate the + // blended frame count, and implicitly clipped all subsequent passes. This + // functionaliy was removed in API ver 227, which makes `index` behave the + // same for frame and blend stages. + if (info->stage == PL_RENDER_STAGE_BLEND) + index = 0; +#endif + struct mp_pass_perf *perf = &frame->perf[index]; const struct pl_dispatch_info *pass = info->pass; assert(VO_PERF_SAMPLE_COUNT >= MP_ARRAY_SIZE(pass->samples)); -- cgit v1.2.3