Couldn't this be done in a device independent manner in mesa when linking shaders? Drop outputs if there is no matching input in the subsequent shader stage?