[vlc-commits] [Git][videolan/vlc][master] opengl: sampler: handle glsl_version >= 300

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Dec 5 09:34:11 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
1d076bd5 by Alexandre Janniaux at 2023-12-05T09:04:42+00:00
opengl: sampler: handle glsl_version >= 300

The GL_OES_EGL_image_external extension needed by by the interop code
for android is not compatible with GLSL >= 300, since it doesn't support
texture2D(), and texture() wasn't part of the extension before.

The extension GL_OES_EGL_image_external_essl3 must be used instead, but
of course it is not compatible with GLSL < 300 and thus the correct
extension must be chosen depending on the version used.

This patch enables the renderer filter and other filters compatible with
glsl_version >= 300 to use the interop_android code to fix current shader
compilation issues, which is all of the current use case in the codebase
that we need to ensure correct support, and reenable hardware decoding
interop when GLSL version is >= 300.

It doesn't provide a way for filters to request a lower glsl version
from the sampler yet, in particular to ensure compatibility with filters
not compatible with them. It also doesn't move this part of the sampler
code to the interop yet, where the extension is really used.

Fixes #28421

- - - - -


1 changed file:

- modules/video_output/opengl/sampler.c


Changes:

=====================================
modules/video_output/opengl/sampler.c
=====================================
@@ -555,10 +555,15 @@ GetNames(struct vlc_gl_sampler *sampler, GLenum tex_target,
 static int
 InitShaderExtensions(struct vlc_gl_sampler *sampler, GLenum tex_target)
 {
+    struct vlc_gl_sampler_priv *priv = PRIV(sampler);
+
+    const char *image_external = priv->glsl_version >= 300
+        ? "#extension GL_OES_EGL_image_external_essl3 : require\n"
+        : "#extension GL_OES_EGL_image_external : require\n";
+
     if (tex_target == GL_TEXTURE_EXTERNAL_OES)
     {
-        sampler->shader.extensions =
-            strdup("#extension GL_OES_EGL_image_external : require\n");
+        sampler->shader.extensions = strdup(image_external);
         if (!sampler->shader.extensions)
             return VLC_EGENERIC;
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1d076bd5e82b11d4f3f6027102d23ea7b129bcc4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1d076bd5e82b11d4f3f6027102d23ea7b129bcc4
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list