Shader_Minifier icon indicating copy to clipboard operation
Shader_Minifier copied to clipboard

No renaming list is removing functions

Open aW4KeNiNG opened this issue 1 year ago • 2 comments
trafficstars

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;

aW4KeNiNG avatar Apr 18 '24 16:04 aW4KeNiNG

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

laurentlb avatar Apr 18 '24 16:04 laurentlb

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?)

therontarigo avatar Apr 29 '24 14:04 therontarigo