summaryrefslogtreecommitdiff
path: root/src/amd/vulkan/radv_meta_buffer.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2020-10-26 10:44:53 -0700
committerEric Anholt <eric@anholt.net>2020-11-11 08:49:49 -0800
commit4e9328e3b6a917c2a2b27630a25fbc44f822a6d0 (patch)
treeb9e7aa1dbecbc7fe61cb6b01050358b5ac1da642 /src/amd/vulkan/radv_meta_buffer.c
parent1aa1c1aec2ab61e0fe0e7d32b371e85c96e3d6f4 (diff)
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>
Diffstat (limited to 'src/amd/vulkan/radv_meta_buffer.c')
-rw-r--r--src/amd/vulkan/radv_meta_buffer.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/amd/vulkan/radv_meta_buffer.c b/src/amd/vulkan/radv_meta_buffer.c
index 17cdf796a6b..08bfcd2bfd1 100644
--- a/src/amd/vulkan/radv_meta_buffer.c
+++ b/src/amd/vulkan/radv_meta_buffer.c
@@ -7,9 +7,7 @@
static nir_shader *
build_buffer_fill_shader(struct radv_device *dev)
{
- nir_builder b;
-
- nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_COMPUTE, NULL);
+ nir_builder b = nir_builder_init_simple_shader(NULL, MESA_SHADER_COMPUTE, NULL);
b.shader->info.name = ralloc_strdup(b.shader, "meta_buffer_fill");
b.shader->info.cs.local_size[0] = 64;
b.shader->info.cs.local_size[1] = 1;
@@ -55,9 +53,7 @@ build_buffer_fill_shader(struct radv_device *dev)
static nir_shader *
build_buffer_copy_shader(struct radv_device *dev)
{
- nir_builder b;
-
- nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_COMPUTE, NULL);
+ nir_builder b = nir_builder_init_simple_shader(NULL, MESA_SHADER_COMPUTE, NULL);
b.shader->info.name = ralloc_strdup(b.shader, "meta_buffer_copy");
b.shader->info.cs.local_size[0] = 64;
b.shader->info.cs.local_size[1] = 1;