From 4f0206ab045e65798eef7e6e1efe0d862fe7b7f7 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 30 Apr 2020 00:21:34 +0200 Subject: vo_gpu: enable frame caching for still frames For some reason this was never done? Looking through the code, it was never the case that the frame cache was hit for still frames. I have no idea why not. It makes a lot of sense to do so. Notably, this massively improves the performance of updating the OSC when viewing e.g. large still images, or while paused. (Tested on a 4000x8000 image, the OSC now responds smoothly to user input) --- video/out/gpu/video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 4d14eb8019..41c021bd94 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -3286,9 +3286,9 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, // For the non-interpolation case, we draw to a single "cache" // texture to speed up subsequent re-draws (if any exist) struct ra_fbo dest_fbo = fbo; - if (frame->num_vsyncs > 1 && frame->display_synced && - !p->dumb_mode && (p->ra->caps & RA_CAP_BLIT) && - fbo.tex->params.blit_dst) + bool repeats = frame->num_vsyncs > 1 && frame->display_synced; + if ((repeats || frame->still) && !p->dumb_mode && + (p->ra->caps & RA_CAP_BLIT) && fbo.tex->params.blit_dst) { // Attempt to use the same format as the destination FBO // if possible. Some RAs use a wrapped dummy format here, -- cgit v1.2.3