diff --git a/src/gallium/frontends/rusticl/mesa/compiler/nir.rs b/src/gallium/frontends/rusticl/mesa/compiler/nir.rs index f386ca29ef1..e8e9f078fd3 100644 --- a/src/gallium/frontends/rusticl/mesa/compiler/nir.rs +++ b/src/gallium/frontends/rusticl/mesa/compiler/nir.rs @@ -484,6 +484,14 @@ impl NirShader { } } +impl Clone for NirShader { + fn clone(&self) -> Self { + Self { + nir: unsafe { NonNull::new_unchecked(self.dup_for_driver()) }, + } + } +} + impl Drop for NirShader { fn drop(&mut self) { unsafe { ralloc_free(self.nir.as_ptr().cast()) };