diff options
author | Karol Herbst <kherbst@redhat.com> | 2022-11-22 23:00:46 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-03-31 20:29:00 +0000 |
commit | 87147e2b097b09d58267e6584cb96de43173bbf3 (patch) | |
tree | 6b66d4dc6ce6db0839aff7b9311358e9e4963ab4 /src/gallium | |
parent | 0e5722cd222f05896ee36c6a2b58f54469db8c1c (diff) |
rusticl/kernel: set has_variable_shared_mem on the nir
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/frontends/rusticl/core/kernel.rs | 6 | ||||
-rw-r--r-- | src/gallium/frontends/rusticl/mesa/compiler/nir.rs | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index fc102f183e6..2810f240888 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -688,6 +688,12 @@ fn lower_and_optimize_nir_late( * other things we depend on */ KernelArg::assign_locations(args, &mut res, nir); + + /* update the has_variable_shared_mem info as we might have DCEed all of them */ + nir.set_has_variable_shared_mem( + args.iter() + .any(|arg| arg.kind == KernelArgType::MemLocal && !arg.dead), + ); dev.screen.finalize_nir(nir); nir.pass0(nir_opt_dce); diff --git a/src/gallium/frontends/rusticl/mesa/compiler/nir.rs b/src/gallium/frontends/rusticl/mesa/compiler/nir.rs index 7063b67334c..a7cfb6c8beb 100644 --- a/src/gallium/frontends/rusticl/mesa/compiler/nir.rs +++ b/src/gallium/frontends/rusticl/mesa/compiler/nir.rs @@ -186,6 +186,17 @@ impl NirShader { } } + pub fn set_has_variable_shared_mem(&mut self, val: bool) { + unsafe { + self.nir + .as_mut() + .info + .anon_1 + .cs + .set_has_variable_shared_mem(val) + } + } + pub fn variables_with_mode( &mut self, mode: nir_variable_mode, |