summaryrefslogtreecommitdiffstats
path: root/video/out/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gpu')
-rw-r--r--video/out/gpu/ra.h2
-rw-r--r--video/out/gpu/video.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/video/out/gpu/ra.h b/video/out/gpu/ra.h
index 08ccdaee70..34f3fb9b5c 100644
--- a/video/out/gpu/ra.h
+++ b/video/out/gpu/ra.h
@@ -85,6 +85,8 @@ struct ra_format {
// only applies to 2-component textures
bool linear_filter; // linear filtering available from shader
bool renderable; // can be used for render targets
+ bool dummy_format; // is not a real ra_format but a fake one (e.g. FBO).
+ // dummy formats cannot be used to create textures
// If not 0, the format represents some sort of packed fringe format, whose
// shader representation is given by the special_imgfmt_desc pointer.
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;