From e5410f9b00e60fb47e7737f7b5357398c3b2f7bc Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 26 Jun 2023 10:20:04 -0400 Subject: [PATCH] nir: Add nir_builder_create returning nir_builder More ergonomic. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Konstantin Seurer Part-of: --- src/compiler/nir/nir_builder.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 8002c324309..b71d1400c4c 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -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,