ac/nir: Make scan_shader_output_decl less dependent on the context.