Module: Mesa
Branch: staging/23.1
Commit: 748697bc2a0cdeb38f89e31c942517393d616254
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=748697bc2a0cdeb38f89e31c942517393d616254

Author: Karol Herbst <[email protected]>
Date:   Mon Jul 31 12:19:22 2023 +0200

rusticl/kernel: only handle function_temp memory before lowering printf

There was no need to handle the other variable modes. This also fixes
double accounting of shared memory.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9058
Fixes: 5795ee0e083 ("rusticl: translate spirv to nir and first steps to kernel 
arg handling")
Signed-off-by: Karol Herbst <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24398>
(cherry picked from commit 01cb01a7ee9781dd494681433c7d40828c7b53c6)

---

 .pick_status.json                            |  2 +-
 src/gallium/frontends/rusticl/core/kernel.rs | 11 ++++-------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 08fb1c5e37b..561cf261663 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1003,7 +1003,7 @@
         "description": "rusticl/kernel: only handle function_temp memory 
before lowering printf",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "5795ee0e08355ea2445ec9d4b2235a3a35ceda83"
     },
diff --git a/src/gallium/frontends/rusticl/core/kernel.rs 
b/src/gallium/frontends/rusticl/core/kernel.rs
index e1ce6f0d4bc..dd5d6369e71 100644
--- a/src/gallium/frontends/rusticl/core/kernel.rs
+++ b/src/gallium/frontends/rusticl/core/kernel.rs
@@ -444,12 +444,7 @@ fn lower_and_optimize_nir_pre_inputs(dev: &Device, nir: 
&mut NirShader, lib_clc:
     nir.pass0(nir_dedup_inline_samplers);
     nir.pass2(
         nir_lower_vars_to_explicit_types,
-        nir_variable_mode::nir_var_uniform
-            | nir_variable_mode::nir_var_function_temp
-            | nir_variable_mode::nir_var_shader_temp
-            | nir_variable_mode::nir_var_mem_shared
-            | nir_variable_mode::nir_var_mem_generic
-            | nir_variable_mode::nir_var_mem_global,
+        nir_variable_mode::nir_var_function_temp,
         Some(glsl_get_cl_type_size_align),
     );
 
@@ -647,8 +642,10 @@ fn lower_and_optimize_nir_late(
         nir_lower_vars_to_explicit_types,
         nir_variable_mode::nir_var_mem_shared
             | nir_variable_mode::nir_var_function_temp
+            | nir_variable_mode::nir_var_shader_temp
             | nir_variable_mode::nir_var_uniform
-            | nir_variable_mode::nir_var_mem_global,
+            | nir_variable_mode::nir_var_mem_global
+            | nir_variable_mode::nir_var_mem_generic,
         Some(glsl_get_cl_type_size_align),
     );
 

Reply via email to