[vlc-commits] gl: don't do direct rendering below OpenGL 3.0

Thomas Guillem git at videolan.org
Wed Jul 12 16:22:19 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 12 15:50:34 2017 +0200| [a455b0953f448d3be5c2ffd7689234294eaf26fd] | committer: Thomas Guillem

gl: don't do direct rendering below OpenGL 3.0

See comments.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a455b0953f448d3be5c2ffd7689234294eaf26fd
---

 modules/video_output/opengl/converters.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/converters.c b/modules/video_output/opengl/converters.c
index 2e0bd60675..15176e8bab 100644
--- a/modules/video_output/opengl/converters.c
+++ b/modules/video_output/opengl/converters.c
@@ -1125,7 +1125,14 @@ generic_init(opengl_tex_converter_t *tc, bool allow_dr)
         const bool has_bs =
             HasExtension(tc->glexts, "GL_ARB_buffer_storage") ||
             HasExtension(tc->glexts, "GL_EXT_buffer_storage");
-        supports_map_persistent = has_pbo && has_bs && tc->api->BufferStorage
+
+        /* Ensure we do direct rendering with OpenGL 3.0 or higher. Indeed,
+         * persistent mapped buffers seems to be slow with OpenGL 2.1 drivers
+         * and bellow. This may be caused by OpenGL compatibility layer. */
+        const unsigned char *ogl_version = glGetString(GL_VERSION);
+        const bool glver_ok = strverscmp((const char *)ogl_version, "3.0") >= 0;
+
+        supports_map_persistent = glver_ok && has_pbo && has_bs && tc->api->BufferStorage
             && tc->api->MapBufferRange && tc->api->FlushMappedBufferRange
             && tc->api->UnmapBuffer && tc->api->FenceSync && tc->api->DeleteSync
             && tc->api->ClientWaitSync;



More information about the vlc-commits mailing list