Shader ID optimizations and alpha test optimization

This should make the alpha test cheaper and work potentially more often on PowerVR, at least in the common case of `!= 0` or `> 0`.

This also improves performance of the id generation functions a bit (mostly the fragment one.)  There's also a small overlap fix too.  I wonder if it could be related to the prescale bugs?  Probably not...

-[Unknown]