Fixed some performance issues with shaders.