[vlc-commits] gl: don't do direct rendering under OpenGL 3.0
Thomas Guillem
git at videolan.org
Wed Jul 12 15:52:05 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 12 15:50:34 2017 +0200| [82a0b700dc2bb45caf3a76cf8699df1f0ac9d164] | committer: Thomas Guillem
gl: don't do direct rendering under OpenGL 3.0
See comments.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82a0b700dc2bb45caf3a76cf8699df1f0ac9d164
---
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..5b69dec31b 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 under. 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