Skip to content

opengl: simplify generated GLSL code

Romain Vimont requested to merge rom1v/vlc:glsl_simplify into master

Now that TexCoordsMap is the same for all planes, initializing the pixel vec4 in several steps is not necessary anymore.

Concretely, replace:

    vec4 texel;
    vec4 pixel = vec4(0.0, 0.0, 0.0, 1.0);
    texel = texture2D(Textures[0], tex_coords);
    pixel[0] = texel.r;
    texel = texture2D(Textures[1], tex_coords);
    pixel[1] = texel.r;
    texel = texture2D(Textures[2], tex_coords);
    pixel[2] = texel.r;

by:

    vec4 pixel = vec4(
     texture2D(Textures[0], tex_coords).r,
     texture2D(Textures[1], tex_coords).r,
     texture2D(Textures[2], tex_coords).r,
     1.0);

This is a minor change.

Merge request reports

Loading