> This should be done per nir function, and I suggest to divide this function > into more sub-functions to follow conventions of other nir_lower_* > implementation. You only should be writing gl_Position once anyway; why reinit for functions that likely won't use them? lower_alpha_test does it this way; it's fine.