[vlc-commits] [Git][videolan/vlc][3.0.x] 3 commits: opengl: explicitly set swizzle_per_tex values

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Fri Mar 25 10:16:29 UTC 2022



Hugo Beauzée-Luyssen pushed to branch 3.0.x at VideoLAN / VLC


Commits:
d973d2f3 by Romain Vimont at 2022-03-25T10:00:54+00:00
opengl: explicitly set swizzle_per_tex values

As explained in commit 1e72174721e4af164b23e00578e097f029494260 (in
VLC4):

> In case the texture format is GL_LUMINANCE, swizzle_per_tex was set to
> {NULL, "xa"}. Using NULL instead of an explicit swizzle ("x") was a
> small optimization to assign the texel value directly [...]
>
> This was possible because the texture exposes the luminance value in
> its three components: (L, L, L, 1).

In fact, using the luminance value in the 3 components is not equivalent
(and wrong). Therefore, explicitly use the texture swizzle.

Cherry-picked from 1e72174721e4af164b23e00578e097f029494260

Note: only the assignment is cherry-picked, the associated refactor is
not applied to minimize code changes on VLC3.

- - - - -
4082f4f2 by Romain Vimont at 2022-03-25T10:00:54+00:00
opengl: fix swizzle

The four components are, in order: x, y, z, w.

The U and V values are the first and second components in the second
texture.

Fixes #26735
Fixes #26336

Cherry-picked from 05f292874df8b29a0f3b60d49d39f4269a2b2ca8

- - - - -
d6ffeba2 by Romain Vimont at 2022-03-25T10:00:54+00:00
opengl: simplify swizzle

The commit ca7d2ea4b618b5bc1a8a03c0318d4f2afaf3007f introduced an xyzw
swizzle, whereas the previous code was using an rgba swizzle. No other
location used the xyzw swizzle for texture so unify and use rgba
everywhere.

Refs #26735

Cherry-picked from aa5bec3b49a790709bcf2c7d874552916da2aea1

- - - - -


1 changed file:

- modules/video_output/opengl/fragment_shaders.c


Changes:

=====================================
modules/video_output/opengl/fragment_shaders.c
=====================================
@@ -198,16 +198,8 @@ tc_yuv_base_init(opengl_tex_converter_t *tc, GLenum tex_target,
         else
             return VLC_EGENERIC;
 
-        if (oneplane_texfmt == GL_RED)
-        {
-            swizzle_per_tex[0] = "r";
-            swizzle_per_tex[1] = "rg";
-        }
-        else
-        {
-            swizzle_per_tex[0] = NULL;
-            swizzle_per_tex[1] = "xa";
-        }
+        swizzle_per_tex[0] = "r";
+        swizzle_per_tex[1] = "rg";
     }
     else if (desc->plane_count == 1)
     {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c7cfe89c7d6e5032c08fd1cc5a2e173c684cac6f...d6ffeba288c533f0531541fe8a97d8bda60fd25c

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