mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
rusticl/mesa: implement Clone for NirShader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30152>
This commit is contained in:
parent
89b2c3927e
commit
76b2236834
1 changed files with 8 additions and 0 deletions
|
|
@ -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()) };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue