diff options
author | wm4 <wm4@nowhere> | 2017-08-05 13:39:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-05 13:44:30 +0200 |
commit | dd096863fa00f1c0c9268932a46ddc321122f552 (patch) | |
tree | 49956dd4bcd2a0d12e298107f7aeeff7a61e28e4 /video/out/opengl/video.c | |
parent | 8dd4ae13ffd5ff11b97b84bbb4fdfe6185eeeb50 (diff) | |
download | mpv-dd096863fa00f1c0c9268932a46ddc321122f552.tar.bz2 mpv-dd096863fa00f1c0c9268932a46ddc321122f552.tar.xz |
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.
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r-- | video/out/opengl/video.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |