This is something that really should be done in higher level code - the shader interface should only concern itself with the shader and not the conditions that block its use. The Shader class has been redone as a thin wrapper and been deprecated.