ac/nir: fix out-of-bound access when loading constants from global