nir: Add nir_builder_create returning nir_builder

More ergonomic.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23860>
This commit is contained in:
Alyssa Rosenzweig 2023-06-26 10:20:04 -04:00 committed by Marge Bot
parent ddb7cf7a25
commit e5410f9b00

View file

@ -50,6 +50,14 @@ typedef struct nir_builder {
void nir_builder_init(nir_builder *build, nir_function_impl *impl);
static inline nir_builder
nir_builder_create(nir_function_impl *impl)
{
nir_builder b;
nir_builder_init(&b, impl);
return b;
}
nir_builder MUST_CHECK PRINTFLIKE(3, 4)
nir_builder_init_simple_shader(gl_shader_stage stage,
const nir_shader_compiler_options *options,