Add shader group queries for which closures are used

Very analogous to how we can query which textures are used.