Shader_Minifier
Shader_Minifier copied to clipboard
Remove unused #define
If there's a #define
in a file, but the macro is not used anywhere, we should delete it.
With the preprocessor, this will become common:
#define PRETTIER 1
#ifdef PRETTIER
...
#endif
The preprocessor can evaluate and remove the #ifdef
line, but it doesn't know if the macro should be preserved or not.
Gotta implement actual replacement of tokens in the code... Then the #define can always be deleted.
We don't want to remove all defines, just the ones that are not used.
Evaluating and removing defines could yield a smaller output.
Or in many cases, larger...
In any case, inlining the defines is an independent feature request.