Is there a HLSL packer/minifier? (And a wish of potentially enhancing the performance of the shader?)
2 Answers
Yes, see link here. It's a shader minifier written in F#.
Don't expect any performance improvements though. This only aims at reducing shader size so that demo makers can respect the overall 4K/ 64K restriction.

- 12,046
- 5
- 43
- 79
-
Indeed (I'm the author), it's made to pack the code and obfuscate it. It won't improve or speed up the shader. – Laurent May 17 '11 at 21:38
I doubt that this would be helpful. The chief goal of a Javascript minifier is to reduce the size of the source file so that the client has less data to download, speeding up the site. However, since the user would be downloading HLSL code, they wouldn't see any performance benefits.
If you're deadset on minifying the source, such a thing would be trivial to implement. Just write a script in your language of choice to replace newlines with a space and multiple spaces with one space (I don't know HLSL but this should work since it's like C). If you'd like to see a well-written example, check out the C source for JSMin.

- 75,757
- 21
- 156
- 151
-
This is great information. I was more under the impression that the minifier enhanced the performance of the Javascript. I guess that is what I am after, but for HLSL - if there is such a thing? – Neil Knight Mar 26 '11 at 18:00
-
1@Neil some minifiers do perform optimizations on JS as well. In your case, the compiler would be responsible for optimizations. – Rafe Kettler Mar 26 '11 at 18:00