laurentlb / shader-minifier

Minify and obfuscate GLSL or HLSL code

Home Page:https://ctrl-alt-test.fr/minifier/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No renaming list is removing functions

aW4KeNiNG opened this issue · comments

The minimal case is:

precision highp float;

varying vec4 vColor;

void main() {
        gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
}

using shader_minifier.exe -o output.glsl --format text --no-renaming-list "vColor" input.glsl

the result is:

precision highp float;varying vec4 vColor;

The behavior is indeed surprising.
For now, use --no-renaming-list vColor,main to keep main.

The behavior shouldn't be changed as it is working as described, but this particular gotcha could be pointed out in documentation.

No renaming list is not removing functions, but rather:

  • renamed unused functions are always removed by default
  • no-renaming-list functions are not removed
  • The default no-renaming-list is main (and mainImage, because of Shadertoy?)