[vlc-devel] [PATCH] opengl: Fix sub renderer shaders for non OpenGL ES
Alexandre Janniaux
ajanni at videolabs.io
Sat Feb 15 10:22:15 CET 2020
Hi,
LGTM,
Regards,
--
Alexandre Janniaux
Videolabs
On Sat, Feb 15, 2020 at 01:59:02AM +0100, Marvin Scholz wrote:
> Fixes a regression causing failure to compile these shaders on macOS,
> introduced in 7b37967062de2a23dd6bca82ec5d7574e3783a05
> ---
> modules/video_output/opengl/sub_renderer.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/modules/video_output/opengl/sub_renderer.c b/modules/video_output/opengl/sub_renderer.c
> index f91e663eec..f25900fd1c 100644
> --- a/modules/video_output/opengl/sub_renderer.c
> +++ b/modules/video_output/opengl/sub_renderer.c
> @@ -147,7 +147,11 @@ static GLuint
> CreateProgram(vlc_object_t *obj, const opengl_vtable_t *vt)
> {
> static const char *const VERTEX_SHADER_SRC =
> +#if defined(USE_OPENGL_ES2)
> "#version 100\n"
> +#else
> + "#version 120\n"
> +#endif
> "attribute vec2 vertex_pos;\n"
> "attribute vec2 tex_coords_in;\n"
> "varying vec2 tex_coords;\n"
> @@ -157,8 +161,12 @@ CreateProgram(vlc_object_t *obj, const opengl_vtable_t *vt)
> "}\n";
>
> static const char *const FRAGMENT_SHADER_SRC =
> +#if defined(USE_OPENGL_ES2)
> "#version 100\n"
> "precision mediump float;\n"
> +#else
> + "#version 120\n"
> +#endif
> "uniform sampler2D sampler;\n"
> "uniform float alpha;\n"
> "varying vec2 tex_coords;\n"
> --
> 2.21.1 (Apple Git-122.3)
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list