From f72a33d2cb223df921967cfe7ae203f882ba6921 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 5 Aug 2017 13:48:46 +0200 Subject: vo_opengl: organize ra PBO flag slightly differently Instead of having a mutable ra_tex field (and the only one), move the flag to struct ra, since we have only 2 tex_upload user calls anyway, and both want the same PBO behavior. (At first I considered making it a RA_TEX_UPLOAD_ flag, but why bother. PBOs are a terribly GL-specific thing, so we can't expect a reasonable abstraction of it anyway.) --- video/out/opengl/video.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 3442e9fb59..b9d91936e7 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -505,10 +505,8 @@ static void reinit_osd(struct gl_video *p) { mpgl_osd_destroy(p->osd); p->osd = NULL; - if (p->osd_state) { + if (p->osd_state) p->osd = mpgl_osd_init(p->ra, p->log, p->osd_state); - mpgl_osd_set_options(p->osd, p->opts.pbo); - } } static void uninit_rendering(struct gl_video *p) @@ -3320,9 +3318,6 @@ static bool pass_upload_image(struct gl_video *p, struct mp_image *mpi, uint64_t plane->flipped = mpi->stride[0] < 0; - // (It's unclear whether this should be changeable on the fly.) - plane->tex->use_pbo = p->opts.pbo; - struct dr_buffer *mapped = gl_find_dr_buffer(p, mpi->planes[n]); p->ra->fns->tex_upload(p->ra, plane->tex, mpi->planes[n], @@ -3709,6 +3704,7 @@ static void reinit_from_options(struct gl_video *p) check_gl_features(p); uninit_rendering(p); gl_sc_set_cache_dir(p->sc, p->global, p->opts.shader_cache_dir); + p->ra->use_pbo = p->opts.pbo; gl_video_setup_hooks(p); reinit_osd(p); -- cgit v1.2.3