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

Thomas Guillem git at videolan.org
Tue Jul 10 13:44:39 CEST 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jul  9 13:43:50 2018 +0200| [2999f776da041c77e586bfe88ed55f326ab7a412] | 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

(cherry picked from commit c1b43715870f8bb7f07a6eb76922d291e51a1951)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 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 cb70b723ed..8626024a65 100644
--- a/modules/video_output/opengl/converter_sw.c
+++ b/modules/video_output/opengl/converter_sw.c
@@ -594,21 +594,22 @@ opengl_tex_converter_generic_init(opengl_tex_converter_t *tc, bool allow_dr)
     {
         bool supports_map_persistent = false;
 
-        const bool has_pbo =
-            HasExtension(tc->glexts, "GL_ARB_pixel_buffer_object") ||
-            HasExtension(tc->glexts, "GL_EXT_pixel_buffer_object");
-
-        const bool has_bs =
-            HasExtension(tc->glexts, "GL_ARB_buffer_storage") ||
-            HasExtension(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 &&
+            (HasExtension(tc->glexts, "GL_ARB_pixel_buffer_object") ||
+             HasExtension(tc->glexts, "GL_EXT_pixel_buffer_object"));
+
+        const bool has_bs = has_pbo &&
+            (HasExtension(tc->glexts, "GL_ARB_buffer_storage") ||
+             HasExtension(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