diff options
author | Niklas Haas <git@haasn.xyz> | 2020-04-30 00:21:34 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2020-04-30 00:23:13 +0200 |
commit | 4f0206ab045e65798eef7e6e1efe0d862fe7b7f7 (patch) | |
tree | 0fe8614a28ea7a6269cc9e8e5a04a5f1db784d70 /video/out | |
parent | 2aa5964b43fdd1d584b4f17899aa1ac5e886b7af (diff) | |
download | mpv-4f0206ab045e65798eef7e6e1efe0d862fe7b7f7.tar.bz2 mpv-4f0206ab045e65798eef7e6e1efe0d862fe7b7f7.tar.xz |
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)
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/gpu/video.c | 6 |
1 files 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, |