Releases: laurentlb/shader-minifier
Releases · laurentlb/shader-minifier
1.5.1
Bug fix for sampler types, when argument is inlined.
What's Changed
- Force inline sampler types after argument inlining (fixes #496) by @eldritchconundrum in #498
Full Changelog: 1.5.0...1.5.1
1.5.0
Major Changes
- More inlining
- More unused stuff removal
- The new function renaming strategy makes the code more compressible, if there are many functions. On an 8k intro, it saved around 80 to 100 bytes after compression.
What's Changed
- Inlining and vector access rewrites by @eldritchconundrum in #427
- Treat as external the global fields of an interface block by @eldritchconundrum in #431
- Basic support for HLSL templating by @new-cassellito in #434
- Handle spaces in file names, fixes #438 by @eldritchconundrum in #439
- Better representation for struct and interface blocks in the AST by @eldritchconundrum in #451
- Improve inlining by @eldritchconundrum in #452
- Argument inlining: inline read-only globals, fixes #450 by @eldritchconundrum in #453
- Refactor the AST visitor by @eldritchconundrum in #454
- Preprocess: filter out #line directives by @therontarigo in #457
- Remove unused assignments. Fixes #443, #444, #445 by @eldritchconundrum in #459
- Don't move declarations that use shadowing. Fixes #458 by @eldritchconundrum in #461
- Pragma to force function inlining by @eldritchconundrum in #462
- Fix reuseExistingVarDecl trigger condition by @eldritchconundrum in #463
- Remove decimal point from scientific notation. Fixes #476 by @therontarigo in #477
- Modernize and reorganize projects and solutions by @eldritchconundrum in #479
- commands.txt: remove tests that conflict with others by @laurentlb in #488
- Constant propagation of array length (fixes #483) by @eldritchconundrum in #489
- Add --version by @laurentlb in #490
- Remove spaces in layout by @laurentlb in #491
- Allow return types to have precision qualifiers by @laurentlb in #492
- More function overloading in output by @laurentlb in #465
- Fix #472, commutativity-dependent rewrite by @eldritchconundrum in #493
- Lints and clean ups by @eldritchconundrum in #494
- Structs by @eldritchconundrum in #495
New Contributors
- @new-cassellito made their first contribution in #434
Full Changelog: 1.4.0...1.4.1
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