glsl: delay optimisations on individual shaders when cache is available