Minify GLSL shaders in release export templates to reduce binary size#59203
Minify GLSL shaders in release export templates to reduce binary size#59203Calinou wants to merge 1 commit intogodotengine:masterfrom
Conversation
|
This is really not a good idea, the shader is printed on error so it should not be modified. Instead, I would look into compressing the shader using zlib or something else like we compress docs and other things. |
Note that comments are already stripped from shaders (even in Compressing text resources in the binary is still a valuable thing, but ideally, we should do both minification and compression. |
c3ce00a to
f9980ea
Compare
debug targets to reduce binary size|
I've amended the PR to avoid code duplication for the minification routine, and also changed it to only affect release export templates. The binary size reduction has also increased somewhat since I opened this PR (-90 KB -> -103 KB on a stripped Linux x86_64 release export template with LTO). |
f9980ea to
c37070c
Compare
c37070c to
46e2412
Compare
46e2412 to
393a272
Compare
|
Rebased and tested again, it works as expected. The binary size improvement has further increased since I last tested this PR (sizes are for a Linux x86_64 release export template, stripped with LTO):
That's a difference of almost 280 KB. This is likely due to the inclusion of a lot more GLSL code nowadays (e.g. for FSR2). |
This reduces release export template binary sizes by about 103 KB. To avoid interfering with debugging, only `target=template_release` builds make use of GLSL minification.
393a272 to
4322837
Compare
This reduces release export template binary sizes by about 103 KB. To avoid interfering with debugging, only
target=template_releasebuilds make use of GLSL minification.TODO