vlc | branch: master | Niklas Haas <g...@haasn.xyz> | Mon Feb 12 15:29:39 2018 
+0100| [ed3e536fc8dbb121475b41b8977096aaf19d6ff7] | committer: Thomas Guillem

opengl: update for libplacebo v0.4.0 API changes

The ra_ prefix was changed to pl_ for consistency.

Modified-by: Thomas Guillem <tho...@gllm.fr>
Added PL_API_VER checks in order to keep supporting libplacebo 0.2.x. This will
ease packagers maintenance.

Signed-off-by: Thomas Guillem <tho...@gllm.fr>

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

 modules/video_output/opengl/fragment_shaders.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/opengl/fragment_shaders.c 
b/modules/video_output/opengl/fragment_shaders.c
index f959d9a69c..0c91a4db76 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -399,11 +399,18 @@ tc_base_prepare_shader(const opengl_tex_converter_t *tc,
             continue;
 
         struct pl_shader_var sv = res->variables[i];
+#if PL_API_VER >= 4
+        struct pl_var var = sv.var;
+        // libplacebo doesn't need anything else anyway
+        if (var.type != PL_VAR_FLOAT)
+            continue;
+#else
         struct ra_var var = sv.var;
-
         // libplacebo doesn't need anything else anyway
         if (var.type != RA_VAR_FLOAT)
             continue;
+#endif
+
         if (var.dim_m > 1 && var.dim_m != var.dim_v)
             continue;
 
@@ -657,7 +664,12 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t 
*tc, GLenum tex_target,
         tc->uloc.pl_vars = calloc(res->num_variables, sizeof(GLint));
         for (int i = 0; i < res->num_variables; i++) {
             struct pl_shader_var sv = res->variables[i];
-            ADDF("uniform %s %s;\n", ra_var_glsl_type_name(sv.var), 
sv.var.name);
+#if PL_API_VER >= 4
+            const char *glsl_type_name = pl_var_glsl_type_name(sv.var);
+#else
+            const char *glsl_type_name = ra_var_glsl_type_name(sv.var);
+#endif
+            ADDF("uniform %s %s;\n", glsl_type_name, sv.var.name);
         }
 
         // We can't handle these yet, but nothing we use requires them, either

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to