nir_builder: Return a new builder from nir_builder_init_simple_shader().

It's a little inline function, so we can just RAII it for better
ergonomics.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>
This commit is contained in:
Eric Anholt
2020-10-26 10:44:53 -07:00
parent 1aa1c1aec2
commit 4e9328e3b6
38 changed files with 87 additions and 150 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ nir_builder_test::nir_builder_test()
lin_ctx = linear_alloc_parent(mem_ctx, 0);
static const nir_shader_compiler_options options = { };
b = rzalloc(mem_ctx, nir_builder);
nir_builder_init_simple_shader(b, mem_ctx, MESA_SHADER_COMPUTE, &options);
*b = nir_builder_init_simple_shader(mem_ctx, MESA_SHADER_COMPUTE, &options);
}
nir_builder_test::~nir_builder_test()