Skip to content
Snippets Groups Projects
Commit 1d076bd5 authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Steve Lhomme
Browse files

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
parent 1040e9a7
No related branches found
No related tags found
1 merge request!4626opengl: sampler: handle glsl_version >= 300
Pipeline #413095 canceled with stage
in 24 minutes and 19 seconds
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment