Module: Mesa
Branch: main
Commit: 9fa38cf142716644cbe8e2ae2fcdea717e45062f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9fa38cf142716644cbe8e2ae2fcdea717e45062f

Author: Yonggang Luo <[email protected]>
Date:   Fri Jun 23 11:52:07 2023 +0800

vtn: Do not assign main_entry_point->impl twice

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23820>

---

 src/compiler/spirv/spirv_to_nir.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/compiler/spirv/spirv_to_nir.c 
b/src/compiler/spirv/spirv_to_nir.c
index a1f3c033684..723ac93cc1e 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -6628,9 +6628,9 @@ vtn_emit_kernel_entry_point_wrapper(struct vtn_builder *b,
    vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL);
 
    nir_function *main_entry_point = nir_function_create(b->shader, func_name);
-   main_entry_point->impl = nir_function_impl_create(main_entry_point);
-   nir_builder_init(&b->nb, main_entry_point->impl);
-   b->nb.cursor = nir_after_cf_list(&main_entry_point->impl->body);
+   nir_function_impl *impl = nir_function_impl_create(main_entry_point);
+   nir_builder_init(&b->nb, impl);
+   b->nb.cursor = nir_after_cf_list(&impl->body);
    b->func_param_idx = 0;
 
    nir_call_instr *call = nir_call_instr_create(b->nb.shader, entry_point);
@@ -6674,8 +6674,7 @@ vtn_emit_kernel_entry_point_wrapper(struct vtn_builder *b,
       /* we have to copy the entire variable into function memory */
       if (is_by_val) {
          nir_variable *copy_var =
-            nir_local_variable_create(main_entry_point->impl, in_var->type,
-                                      "copy_in");
+            nir_local_variable_create(impl, in_var->type, "copy_in");
          nir_copy_var(&b->nb, copy_var, in_var);
          call->params[i] =
             nir_src_for_ssa(&nir_build_deref_var(&b->nb, copy_var)->dest.ssa);

Reply via email to