Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing behavior when different macro definitions affect the same computation result. #312

Open
lemoon opened this issue Jul 12, 2023 · 0 comments

Comments

@lemoon
Copy link

lemoon commented Jul 12, 2023

precision highp float;
varying vec2 v_texcoordOut;
uniform sampler2D s_texture;
uniform float u_degree;
uniform float u_degree2;

void main(void)
{
#ifdef ALPHA_1
    float alpha = 1.0;
#else
    float alpha = 0.5;
#endif
    gl_FragColor = vec4(texture2D(s_texture, v_texcoordOut).rgb,alpha);
}

mono "$script_dir/shader_minifier.exe" -v --preserve-externals --field-names stpq -o res.h input.frag

// Generated with Shader Minifier 1.3.6 (https://github.com/laurentlb/Shader_Minifier/)
#ifndef RES_H_
# define RES_H_

const char *Basic_frag =
 "precision highp float;varying vec2 v_texcoordOut;"
 "uniform sampler2D s_texture;"
 "uniform float u_degree,u_degree2;"
 "void main()"
 "{"
   "\n#ifdef ALPHA_1\n"
   "\n#else\n"
   "\n#endif\n"
   "gl_FragColor=vec4(texture2D(s_texture,v_texcoordOut).stp,.5);"
 "}";

#endif // RES_H_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant