Normally, osg::State would do this for us (via lastAppliedAttribute), but since we're using a custom StateAttribute to apply all lights at once, we have to track ourselves. Further reduction of GL calls in a typical scene by ~2%