Releases: laurentlb/shader-minifier
Releases · laurentlb/shader-minifier
1.4.0
Major changes
- A new web UI, with a menu to select flags. It shows side-by-side how the shader with minified, with hypertext links to better track variables after renaming.
- Better support for interface blocks (#237).
- kkpView symbol generation for integration in kkpview (usable with kkrunchy and crinkler)
- Better minification through variable reuse, more inlining, more variable shadowing, and more.
- Better tracking of side-effects in the code, which leads to better and safer optimizations.
- Multithreading to make Shader Minifier faster when minifying multiple files together.
- A .NET API, for example if you want to plug the minifier in your C# tool.
- And a bunch of bug fixes!
What's Changed
Main changes include:
- Fix case parsing problem by @eldritchconundrum in #319
- Add basic support for interface blocks by @laurentlb in #335
- Fix #333, export kkpView symbol maps by @eldritchconundrum in #337
- Fix newline issue when declaring a type by @laurentlb in #336
- Update precedence of assign ops relative to the ternary operator by @laurentlb in #344
- Add debugging traces by @eldritchconundrum in #345
- Peephole optims, var scoping (fixes #153) by @eldritchconundrum in #349
- Pure rewrite improvements by @eldritchconundrum in #353
- Simplify a+-b and a--b by @laurentlb in #354
- Beautiful & advanced web UI by @laurentlb in #355
- Expose JS API by @laurentlb in #360
- In a declaration, parenthesis are mandatory around a comma operator by @eldritchconundrum in #363
- Parse decl-less layout as verbatim. Fixes #22, #29 by @eldritchconundrum in #364
- Reuse var by @eldritchconundrum in #367
- Generalize reuse by @eldritchconundrum in #368
- Detect more augmentable operators by @laurentlb in #369
- Reuse function parameters inside the function by @laurentlb in #370
- Augmentable operators optimization: * is not always commutative by @laurentlb in #372
- Augmentable operators optimization: * is commutative when an operand is scalar by @therontarigo in #377
- Use function purity analysis in expression purity by @eldritchconundrum in #379
- Reassignments by @eldritchconundrum in #380
- Fixes #385 by @eldritchconundrum in #386
- Support compound assignments in reassignment detection by @eldritchconundrum in #384
- Shadow variables inside loops and if statements by @laurentlb in #387
- distance(x,y) => length(x-y) by @laurentlb in #392
- Remove the
--smoothstep
flag by @laurentlb in #391 - Remove unnecessary parentheses between ? and : in ternary expressions by @therontarigo in #396
- Rewrite pow(x, 1.0) as x by @eldritchconundrum in #399
- Better handling of spaces in preprocessor directives by @laurentlb in #404
- Printer: add space between + and ++ by @laurentlb in #405
- Keep operand order when removing parens around + and - operators by @laurentlb in #406
- Fix aggressive inlining bug by @eldritchconundrum in #408
- Fixes #317, inlining bugs by @eldritchconundrum in #409
- Fix while rewriting bug by @eldritchconundrum in #410
- Optims by @eldritchconundrum in #411
- Inlining by @eldritchconundrum in #412
- C# API by @laurentlb in #425
New Contributors
- @therontarigo made their first contribution in #377
Full Changelog: 1.3.6...1.4.0
1.3.6
What's Changed
- Optimize decl+return into return by @eldritchconundrum in #283
- Fix bug 'not a swizzle' with custom struct by @laurentlb in #284
- Optimize useless assign before return by @eldritchconundrum in #288
- Sanely handle current function overloading limitations in inlining by @eldritchconundrum in #292
- Iterate remove unused functions by @eldritchconundrum in #293
- Fix potential unsafe swizzle optimizations by @jwatzman in #298
- Fix mutated idents in functions which are inlined more than once by @jwatzman in #299
- Argument inlining by @eldritchconundrum in #301
- Add ifdef in the output of c-array by @laurentlb in #304
- Fix precedence of the ?: operator by @laurentlb in #306
- Printer: use space before underscore by @laurentlb in #308
Full Changelog: 1.3.5...1.3.6
Shader Minifier 1.3.5
What's Changed
- Significant changes to the inlining heuristics by @eldritchconundrum and @laurentlb
- Respect no-renaming-list when renaming variables too by @laurentlb in #236
- Fix printing of array types by @laurentlb in #244
- Fix int overflow when simplifying vectors by @laurentlb in #246
- Apply vector simplification only when the number of arguments matches by @laurentlb in #251
- Use int64 instead of int32 in the AST by @laurentlb in #252
- vec: remove the useless swizzles in the last argument by @laurentlb in #253
- Initial implementation of a preprocessor, handles #ifdef by @laurentlb in #254
- Remove parentheses with unary minus by @laurentlb in #260
- Underscore is a letter by @laurentlb in #261
- Printer: put "else if" on a single line, for readability by @laurentlb in #262
- Printer: fix printing of do-while loops by @laurentlb in #263
Full Changelog: 1.3.4...1.3.5
Shader Minifier 1.3.4
Shader Minifier 1.3.3
What's Changed
Main changes include:
- Augmented operators: x=x+... becomes x+= by @laurentlb in #206
- Change if statements to if expressions by @eldritchconundrum in #207
- Improve float minification by @eldritchconundrum in #210
- Fix constant ">=" simplification by @eldritchconundrum in #211
- if+return optimizations by @eldritchconundrum in #209
- Rewrite while into for, take opportunities to save semi-colons by @eldritchconundrum in #213
- Vector constructor: use float when it's shorter than the int by @laurentlb in #216
- NoMoveDeclarations is the default by @laurentlb in #217
- Use context-based renaming when minifying multiple files by @laurentlb in #219
- Shorten the generated header by @laurentlb in #220
- Eliminate "!" in condition by swapping if and else by @eldritchconundrum in #223
- New output format: Rust by @Kwarf in #227
New Contributors
Full Changelog: 1.3.2...1.3.3
Shader Minifier 1.3.2
What's Changed
Main changes include:
- Preserve comments inside verbatim blocks by @laurentlb in #170
- Inlining: inline more variables by @laurentlb in #174
- Unused functions are removed by default by @eldritchconundrum in #182
- Optimize conditional expressions by @laurentlb in #183
- Arithmetic: better matching of int operations; disable the unsafe x*0 optimization by @laurentlb in #187
- Make PI detection a bit less sensitive by @laurentlb in #188
- Optimize vec constructors using swizzles by @laurentlb in #190
- Skip useless vec constructors by @laurentlb in #191
- Prefer ints instead of floats in the vec constructor by @laurentlb in #192
- Simplify call to vec when all arguments are equal by @laurentlb in #193
- Inline const values of type int,float,bool by @laurentlb in #194
- Apply the sequence operator trick only when it's useful by @laurentlb in #196
- Group declarations by @laurentlb in #197
- Disable dead code removal if there's a preprocessor directive by @laurentlb in #198
- Recursively remove unused functions by @laurentlb in #199
Full Changelog: 1.3.1...1.3.2
Shader Minifier 1.3.1
What's Changed
Main changes include:
- Support "precision" statements by @laurentlb in #161
- Aggro-inlining: don't inline variables with a prefix ++ or -- operator by @laurentlb in #164
- Fix stackoverflow error in simplifyExpr by @laurentlb in #165
Full Changelog: 1.3...1.3.1
Shader Minifier 1.3
What's Changed
(some changes, e.g. documentation, cleanup, or refactoring, are not included in this list)
- Support switch statements by @jwatzman in #132
- Iterate inlining and simplification until we can do no more by @jwatzman in #133
- Drop "in" qualifier from function parameters by @jwatzman in #134
- Add option to aggressively inline all literals and consts by @jwatzman in #136
- Add struct names to forbidden list by @jwatzman in #137
- Iterate inlining and simplification only when we actually inline by @jwatzman in #138
- Allow inlining one-line functions by @jwatzman in #139
- Macro names: preserve the case of the original variable names by @laurentlb in #148
- Fix dangling else bug by @laurentlb in #150
- Swap operands of commutative operators to reduce the number of parentheses by @laurentlb in #151
- Shader Minifier website using Bolero F# by @laurentlb in #155
- Support array types by @laurentlb in #159
New Contributors
- @virtualzavie made their first contribution in #131
- @jwatzman made their first contribution in #132
Full Changelog: 1.2...1.3
Shader Minifier 1.2
What's Changed
- Make Shader Minifier twice as fast by @laurentlb in #48
- Migrate option parser to Argu by @laurentlb in #50
- Use template string for JS output by @laurentlb in #53
- Fix parentheses when the comma operator is in a function call by @laurentlb in #57
- Rewriter: remove useless braces in a few more cases by @laurentlb in #61
- Parser: better support for HLSL geometry shaders by @laurentlb in #63
- README: Add proper documentation by @laurentlb in #64
- Rewrite the full pi constant as acos(-1.) by @eldritchconundrum in #66
- Fix -0.0 by @eldritchconundrum in #74
- Allow shadowing of external values by @laurentlb in #86
- Optimize the use of 2-letter characters by @laurentlb in #87
- Properly rename exported values in a multifile context by @laurentlb in #98
- New renaming strategy for when minifying multiple files by @laurentlb in #100
- New formatting output: indented text by @laurentlb in #109
- Inlining: automatically inline trivial values by @laurentlb in #112
- Improve float precision by @laurentlb in #117
- Add option to disable auto-inlining and document it by @laurentlb in #119
- Automatically remove unused local variables by @laurentlb in #120
- Even better formatting of floats by @laurentlb in #122
Full Changelog: 1.1.6...1.2
Shader Minifier 1.1.6
Bump version to 1.1.6