summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-09-26 21:14:34 +0200
committerNiklas Haas <git@haasn.dev>2022-09-26 21:14:34 +0200
commit6b9b032d517763262d416a54dcfe35a15c9c6cb1 (patch)
treebb87468eeff65acd5c2fd82cdb5ccfb66e2a85ba /video/out
parent2b0736ed83a19ec31e0d4b3bf4b3882d7c69063d (diff)
downloadmpv-6b9b032d517763262d416a54dcfe35a15c9c6cb1.tar.bz2
mpv-6b9b032d517763262d416a54dcfe35a15c9c6cb1.tar.xz
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.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_gpu_next.c25
1 files changed, 14 insertions, 11 deletions
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));