#wgsl #shader #graphics #gamedev #wgpu #command-line-tool #name

bin+lib wgsl-minifier

A command-line tool for minifying WGSL shaders

8 unstable releases (3 breaking)

0.4.1 Mar 11, 2024
0.4.0 Feb 28, 2024
0.3.2 Nov 20, 2023
0.2.0 Nov 2, 2023
0.1.2 Aug 2, 2023

#1042 in Game dev

Download history 8/week @ 2024-02-12 149/week @ 2024-02-26 8/week @ 2024-03-04 170/week @ 2024-03-11 27/week @ 2024-03-18 41/week @ 2024-04-01 374/week @ 2024-04-22 222/week @ 2024-04-29 153/week @ 2024-05-06

749 downloads per month
Used in 4 crates (2 directly)

MIT license

16KB
308 lines

WGSL Minifier

crates.io docs.rs crates.io

A small tool built on top of Naga that makes WGSL shaders smaller by performing simple dead code elimination, stripping names of non-exported functions and local variables, and removing as much whitespace as possible.

Usage

To minify your WGSL shader, simply run the following:

cargo install wgsl-minifier
wgsl-minifier path/to/your/shader.wgsl path/to/minified/output.wgsl

Dependencies

~6–14MB
~167K SLoC