From 98dab1aad56bf1c50084aadc99e205e2a30ce437 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 5 Oct 2023 12:51:12 +0200 Subject: [PATCH] rusticl/program: mark NirKernelBuild as Send and Sync Signed-off-by: Karol Herbst Part-of: --- src/gallium/frontends/rusticl/core/program.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/frontends/rusticl/core/program.rs b/src/gallium/frontends/rusticl/core/program.rs index 13e7f5b095c..1aa5a132e6d 100644 --- a/src/gallium/frontends/rusticl/core/program.rs +++ b/src/gallium/frontends/rusticl/core/program.rs @@ -91,6 +91,11 @@ pub struct NirKernelBuild { pub printf_info: Option, } +// SAFETY: `CSOWrapper` is only safe to use if the device supports `PIPE_CAP_SHAREABLE_SHADERS` and +// we make sure to set `nir_or_cso` to `KernelDevStateVariant::Cso` only if that's the case. +unsafe impl Send for NirKernelBuild {} +unsafe impl Sync for NirKernelBuild {} + pub struct ProgramBuild { pub builds: HashMap<&'static Device, ProgramDevBuild>, pub kernel_info: HashMap,