I keep wondering why we have things like Shaderlab and a shader keywords limit.
Is there a good reason for it?
Every single other game engine does fine with a raw implementation of HLSL/GLSL, they have much more better performance than Unity and not to add Shaderlab breaks compatibility with any single shader code snippet you find lying around on the internet.
IIRC somewhere on a forum a (unity) dev said that the reason for shader keywords limit is because they’re mapped to something like individual bits in either a 32bit or 64bit int and are used as flags. You could attempt to find the thread (“shader keyword limit” should be a google query).
The reason for shader keywords is that unity allows great degree of shader customization.
Basically, normally a shader would have a very rigid hardcoded structure, meaning you’ll strictly definied base pass, additive pass, shadow pass, etc.
In unity keywords allow you to toggle portions of the shader at runtime, which gives greater degree of flexibility.
Speaking of performance, I highly doubt it is related to shader keywords.