Is there an HLSL minifier, as is Javascript minifiers?

Is there an HLSL / minifier packer? (And the desire to potentially improve shader performance?)

+4
source share
2 answers

Yes, see the link here . This is a minifier shader written in F #.

Do not expect performance improvements. This is only due to shader size reduction, so that demonstrators can comply with the general 4K / 64K limit.

+3
source

I doubt that would be helpful. The main goal of the Javascript minifier is to reduce the size of the source file so that the client has less data to download, which speeds up the site. However, since the user will download the HLSL code, they will not see any performance benefits.

If you tune in to minimize 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 looks like C). If you want to see a well-written example, check out the C source for JSMin .

+2
source

Source: https://habr.com/ru/post/1345361/


All Articles