mirror of
https://github.com/mpv-player/mpv
synced 2025-04-07 01:53:06 +00:00
vo_opengl: unmap hwdec images once rendering is done
Instead of keeping them for a while. While keeping the mapping was perfectly ok, nothing speaks against reducing the time they're mapped.
This commit is contained in:
parent
7be37337f4
commit
761eeacf54
@ -845,7 +845,8 @@ static void init_video(struct gl_video *p)
|
|||||||
gl_video_setup_hooks(p);
|
gl_video_setup_hooks(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unref_current_image(struct gl_video *p)
|
// Release any texture mappings associated with the current frame.
|
||||||
|
static void unmap_current_image(struct gl_video *p)
|
||||||
{
|
{
|
||||||
struct video_image *vimg = &p->image;
|
struct video_image *vimg = &p->image;
|
||||||
|
|
||||||
@ -856,7 +857,12 @@ static void unref_current_image(struct gl_video *p)
|
|||||||
memset(vimg->planes, 0, sizeof(vimg->planes));
|
memset(vimg->planes, 0, sizeof(vimg->planes));
|
||||||
vimg->hwdec_mapped = false;
|
vimg->hwdec_mapped = false;
|
||||||
}
|
}
|
||||||
mp_image_unrefp(&vimg->mpi);
|
}
|
||||||
|
|
||||||
|
static void unref_current_image(struct gl_video *p)
|
||||||
|
{
|
||||||
|
unmap_current_image(p);
|
||||||
|
mp_image_unrefp(&p->image.mpi);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uninit_video(struct gl_video *p)
|
static void uninit_video(struct gl_video *p)
|
||||||
@ -2802,6 +2808,8 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
|
|||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
unmap_current_image(p);
|
||||||
|
|
||||||
debug_check_gl(p, "after video rendering");
|
debug_check_gl(p, "after video rendering");
|
||||||
|
|
||||||
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo);
|
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||||
|
Loading…
Reference in New Issue
Block a user