diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-29 14:41:52 +0200 |
---|---|---|
committer | Martin Herkt <652892+lachs0r@users.noreply.github.com> | 2017-12-25 00:47:53 +0100 |
commit | a42b8b1142fd26e82ca0e8b0ea7ab6cafd78776d (patch) | |
tree | ae1aa6ea2fd2f91831e5fe671a9be2e018779389 /video/out/gpu/video.c | |
parent | 80540be211adbc9e19c6cb95a1ddfddd890847a9 (diff) | |
download | mpv-a42b8b1142fd26e82ca0e8b0ea7ab6cafd78776d.tar.bz2 mpv-a42b8b1142fd26e82ca0e8b0ea7ab6cafd78776d.tar.xz |
vo_gpu: attempt re-using the FBO format for p->output_tex
This allows RAs with support for non-opaque FBO formats to use a more
appropriate FBO format for the output tex, possibly enabling a more
efficient blit operation.
This requires distinguishing between real formats (which can be used to
create textures) and fake formats (e.g. ra_gl's FBO hack).
Diffstat (limited to 'video/out/gpu/video.c')
-rw-r--r-- | video/out/gpu/video.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 1b50166dc4..3a000aee97 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -3069,9 +3069,15 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, if (frame->num_vsyncs > 1 && frame->display_synced && !p->dumb_mode && (p->ra->caps & RA_CAP_BLIT)) { + // Attempt to use the same format as the destination FBO + // if possible. Some RAs use a wrapped dummy format here, + // so fall back to the fbo_format in that case. + const struct ra_format *fmt = fbo.tex->params.format; + if (fmt->dummy_format) + fmt = p->fbo_format; bool r = ra_tex_resize(p->ra, p->log, &p->output_tex, fbo.tex->params.w, fbo.tex->params.h, - p->fbo_format); + fmt); if (r) { dest_fbo = (struct ra_fbo) { p->output_tex }; p->output_tex_valid = true; |