mesa/st: Deduplicate the NIR uniform lowering code.