From 64d56114ed9258efe2e864315d7130bb58a03d52 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 23 Jul 2017 09:41:51 +0200 Subject: vo_opengl: add direct rendering support Can be enabled via --vd-lavc-dr=yes. See manpage additions for what it does. This reminds of the MPlayer -dr flag, but the implementation is completely different. It's the same basic concept: letting the decoder render into a GPU buffer to avoid a copy. Unlike MPlayer, this doesn't try to go through filters (libavfilter doesn't support this anyway). Unless a filter can work in-place, DR will be silently disabled. MPlayer had very complex semantics about buffer types and management (which apparently nobody ever understood) and weird restrictions that mostly limited it to mpeg2 style codecs. The mpv code does not do any of this, and just lets the decoder allocate an arbitrary number of untyped images. (No MPlayer code was used.) Parts of the code based on work by atomnuker (starting point for the generic code) and haasn (some GL definitions, some basic PBO code, and correct fencing). --- video/out/opengl/common.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'video/out/opengl/common.c') diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index 203c14b7ef..c7eee414ac 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -327,6 +327,14 @@ static const struct gl_functions gl_functions[] = { {0} }, }, + { + .ver_core = 440, + .extension = "GL_ARB_buffer_storage", + .functions = (const struct gl_function[]) { + DEF_FN(BufferStorage), + {0} + }, + }, // Swap control, always an OS specific extension // The OSX code loads this manually. { -- cgit v1.2.3