- nir_shader *shader = nir_shader_create(NULL, MESA_SHADER_FRAGMENT, &midgard_nir_options, NULL);
- nir_function *fn = nir_function_create(shader, "main");
- nir_function_impl *impl = nir_function_impl_create(fn);
+ nir_builder _b;
+ nir_builder_init_simple_shader(&_b, NULL, MESA_SHADER_FRAGMENT, &midgard_nir_options);
+ nir_builder *b = &_b;
+ nir_shader *shader = b->shader;