Query which globals an optimized shader group will need.

New shader group queries: "num_globals_needed", "globals_needed".
Works analogously to asking which textures or userdata are needed by a
(post-optimized) shader group.

Some renderers may find construction of certain globals to be very
expensive, and this allows them to quickly determine exactly which
globals will be needed by the group (*after* full runtime optimization)
so that the renderer can avoid work for globals that will not be used.