[vlc-commits] opengl: don't use PBO buffers before OpenGL 3.0

Thomas Guillem git at videolan.org
Tue Jul 10 13:33:49 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jul  9 13:43:50 2018 +0200| [c1b43715870f8bb7f07a6eb76922d291e51a1951] | committer: Thomas Guillem

opengl: don't use PBO buffers before OpenGL 3.0

The version was checked for persistent mapped buffers, but it's also needed for
PBO usage.

cf. comments

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

 modules/video_output/opengl/converter_sw.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/modules/video_output/opengl/converter_sw.c b/modules/video_output/opengl/converter_sw.c
index 93b0d915d2..5f498b08a6 100644
--- a/modules/video_output/opengl/converter_sw.c
+++ b/modules/video_output/opengl/converter_sw.c
@@ -592,21 +592,22 @@ opengl_tex_converter_generic_init(opengl_tex_converter_t *tc, bool allow_dr)
     {
         bool supports_map_persistent = false;
 
-        const bool has_pbo =
-            vlc_gl_StrHasToken(tc->glexts, "GL_ARB_pixel_buffer_object") ||
-            vlc_gl_StrHasToken(tc->glexts, "GL_EXT_pixel_buffer_object");
-
-        const bool has_bs =
-            vlc_gl_StrHasToken(tc->glexts, "GL_ARB_buffer_storage") ||
-            vlc_gl_StrHasToken(tc->glexts, "GL_EXT_buffer_storage");
-
-        /* 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. */
+        /* Ensure we do direct rendering / PBO with OpenGL 3.0 or higher.
+         * Indeed, persistent mapped buffers or PBO seems to be slow with
+         * OpenGL 2.1 drivers and bellow. This may be caused by OpenGL
+         * compatibility layer. */
         const unsigned char *ogl_version = tc->vt->GetString(GL_VERSION);
         const bool glver_ok = strverscmp((const char *)ogl_version, "3.0") >= 0;
 
-        supports_map_persistent = glver_ok && has_pbo && has_bs && tc->gl->module
+        const bool has_pbo = glver_ok &&
+            (vlc_gl_StrHasToken(tc->glexts, "GL_ARB_pixel_buffer_object") ||
+             vlc_gl_StrHasToken(tc->glexts, "GL_EXT_pixel_buffer_object"));
+
+        const bool has_bs = has_pbo &&
+            (vlc_gl_StrHasToken(tc->glexts, "GL_ARB_buffer_storage") ||
+             vlc_gl_StrHasToken(tc->glexts, "GL_EXT_buffer_storage"));
+
+        supports_map_persistent = has_bs && tc->gl->module
             && tc->vt->BufferStorage && tc->vt->MapBufferRange && tc->vt->FlushMappedBufferRange
             && tc->vt->UnmapBuffer && tc->vt->FenceSync && tc->vt->DeleteSync
             && tc->vt->ClientWaitSync;



More information about the vlc-commits mailing list