From dd096863fa00f1c0c9268932a46ddc321122f552 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 5 Aug 2017 13:39:20 +0200 Subject: vo_opengl: make OSD code use ra for textures This requires a silly extension to ra_fns.tex_upload: since the OSD texture can be much larger than the actual OSD image data to upload, a mechanism for uploading only to a small part of the texture is needed. Otherwise, we'd have to realloc/copy the data, just to pad it, and then pay for uploading the padding too. The RA_TEX_UPLOAD_DISCARD flag is not interpreted by GL (not sure how you'd tell GL about this), but it clarifies the API and might be helpful if we support other backend APIs in the future. --- video/out/opengl/video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 1274cc6e3c..3442e9fb59 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -506,7 +506,7 @@ static void reinit_osd(struct gl_video *p) mpgl_osd_destroy(p->osd); p->osd = NULL; if (p->osd_state) { - p->osd = mpgl_osd_init(p->gl, p->log, p->osd_state); + p->osd = mpgl_osd_init(p->ra, p->log, p->osd_state); mpgl_osd_set_options(p->osd, p->opts.pbo); } } @@ -3326,7 +3326,8 @@ static bool pass_upload_image(struct gl_video *p, struct mp_image *mpi, uint64_t struct dr_buffer *mapped = gl_find_dr_buffer(p, mpi->planes[n]); p->ra->fns->tex_upload(p->ra, plane->tex, mpi->planes[n], - mpi->stride[n], mapped ? mapped->buffer : NULL); + mpi->stride[n], NULL, 0, + mapped ? mapped->buffer : NULL); if (mapped && !mapped->mpi) mapped->mpi = mp_image_new_ref(mpi); -- cgit v1.2.3