From 58e588cde55d44d72f59f717cc43659a7b8a36e6 Mon Sep 17 00:00:00 2001 From: Niklas Haas <git@haasn.xyz> Date: Thu, 21 May 2020 07:37:50 +0200 Subject: [PATCH] renderer: assert if SAMPLER_NOOP implies scaling With ca1ebc, the mismatched shaders of the variety that 092229 was intending to solve should no longer be a possibility. If this is still the case, it's probably a bug. Assert instead. --- src/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer.c b/src/renderer.c index 536e496dc..0cb1441e9 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -1312,7 +1312,6 @@ static bool pass_scale_main(struct pl_renderer *rr, struct pass_state *pass, bool need_fbo = image->num_overlays > 0; need_fbo |= rr->peak_detect_state && !params->allow_delayed_peak_detect; - need_fbo |= src.new_w != img->w || src.new_h != img->h; struct sampler_info info = sample_src_info(rr, &src, params); bool use_sigmoid = info.dir == SAMPLER_UP && params->sigmoid_params; @@ -1335,6 +1334,7 @@ static bool pass_scale_main(struct pl_renderer *rr, struct pass_state *pass, } if (info.dir == SAMPLER_NOOP && !need_fbo) { + pl_assert(src.new_w == img->w && src.new_h == img->h); PL_TRACE(rr, "Skipping main scaler (would be no-op)"); return true; } -- GitLab