[vlc-commits] [Git][videolan/vlc][3.0.x] 4 commits: opengl: use tc->pl_sh directly

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Dec 10 14:46:39 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
b1231297 by Steve Lhomme at 2025-12-10T13:55:26+00:00
opengl: use tc->pl_sh directly

So we don't depend on its actual type.

- - - - -
88d5825b by Steve Lhomme at 2025-12-10T13:55:26+00:00
opengl: use pl_shader_obj typedef in newer libplacebo version

The plain structure is gone in current version.

>From https://code.videolan.org/videolan/libplacebo/-/commit/dd755a09c4a22deaab82da8b4178ce8a50584b7c

- - - - -
8c4e05bc by Steve Lhomme at 2025-12-10T13:55:26+00:00
opengl: use pl_log for the libplacebo context

The pl_context structure was renamed in https://code.videolan.org/videolan/libplacebo/-/commit/2459200a133d1a0f36f092a32a2d5d443cfbee55

It's already initialized with pl_log_create / pl_log_destroy since 65ea8d19d91ac1599a29e8411485a72fe89c45e2
Although there were PL_MAJOR_VER == 4 with this change.

- - - - -
abc817da by Steve Lhomme at 2025-12-10T13:55:26+00:00
opengl: use pl_shader for the libplacebo shader

The pl_context structure was renamed in https://code.videolan.org/videolan/libplacebo/-/commit/dd755a09c4a22deaab82da8b4178ce8a50584b7c

- - - - -


2 changed files:

- modules/video_output/opengl/converter.h
- modules/video_output/opengl/fragment_shaders.c


Changes:

=====================================
modules/video_output/opengl/converter.h
=====================================
@@ -52,6 +52,14 @@
 # endif
 #endif
 
+#ifdef HAVE_LIBPLACEBO
+# include <libplacebo/config.h>
+# if PL_API_VER >= 157
+#  include <libplacebo/log.h>
+#  include <libplacebo/shaders.h>
+# endif
+#endif
+
 #define VLCGL_PICTURE_MAX 128
 
 #ifndef GL_TEXTURE_RECTANGLE
@@ -272,8 +280,12 @@ struct opengl_tex_converter_t
     /* Pointer to object gl, set by the caller */
     vlc_gl_t *gl;
 
+# if PL_API_VER >= 157
+    pl_log pl_ctx;
+# else
     /* libplacebo context, created by the caller (optional) */
     struct pl_context *pl_ctx;
+#endif
 
     /* Function pointers to OpenGL functions, set by the caller */
     const opengl_vtable_t *vt;
@@ -337,7 +349,11 @@ struct opengl_tex_converter_t
     bool yuv_color;
     GLfloat yuv_coefficients[16];
 
+# if PL_API_VER >= 157
+    pl_shader pl_sh;
+# else
     struct pl_shader *pl_sh;
+# endif
     const struct pl_shader_res *pl_sh_res;
 
     /* Private context */


=====================================
modules/video_output/opengl/fragment_shaders.c
=====================================
@@ -611,7 +611,6 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
 
 #ifdef HAVE_LIBPLACEBO
     if (tc->pl_sh) {
-        struct pl_shader *sh = tc->pl_sh;
         struct pl_color_map_params color_params = pl_color_map_default_params;
         color_params.intent = var_InheritInteger(tc->gl, "rendering-intent");
         color_params.tone_mapping_algo = var_InheritInteger(tc->gl, "tone-mapping");
@@ -630,11 +629,15 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
         dst_space.primaries = var_InheritInteger(tc->gl, "target-prim");
         dst_space.transfer = var_InheritInteger(tc->gl, "target-trc");
 
-        pl_shader_color_map(sh, &color_params,
+        pl_shader_color_map(tc->pl_sh, &color_params,
                 pl_color_space_from_video_format(&tc->fmt),
                 dst_space, NULL, false);
 
+# if PL_API_VER >= 157
+        pl_shader_obj dither_state = NULL;
+#else
         struct pl_shader_obj *dither_state = NULL;
+#endif
         int method = var_InheritInteger(tc->gl, "dither-algo");
         if (method >= 0) {
 
@@ -657,13 +660,13 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
                 out_bits = fb_depth;
             }
 
-            pl_shader_dither(sh, out_bits, &dither_state, &(struct pl_dither_params) {
+            pl_shader_dither(tc->pl_sh, out_bits, &dither_state, &(struct pl_dither_params) {
                 .method   = method,
                 .lut_size = 4, // avoid too large values, since this gets embedded
             });
         }
 
-        const struct pl_shader_res *res = tc->pl_sh_res = pl_shader_finalize(sh);
+        const struct pl_shader_res *res = tc->pl_sh_res = pl_shader_finalize(tc->pl_sh);
         pl_shader_obj_destroy(&dither_state);
 
         FREENULL(tc->uloc.pl_vars);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1089af38fc26293d0b93a9456adf7ae4a5b0b930...abc817dac8dd17511b917cd786db2e6730e21e5e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1089af38fc26293d0b93a9456adf7ae4a5b0b930...abc817dac8dd17511b917cd786db2e6730e21e5e
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