rusticl/mesa/nir: mark more methods as mut

Those actually change the nir and are not thread-safe anyway.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
This commit is contained in:
Karol Herbst 2023-10-04 19:27:07 +02:00 committed by Marge Bot
parent 02c433dd87
commit 6189b3fe43

View file

@ -184,7 +184,7 @@ impl NirShader {
unsafe { nir_shader_clone(ptr::null_mut(), self.nir.as_ptr()) }
}
pub fn sweep_mem(&self) {
pub fn sweep_mem(&mut self) {
unsafe { nir_sweep(self.nir.as_ptr()) }
}
@ -239,7 +239,7 @@ impl NirShader {
unsafe { should_print_nir(self.nir.as_ptr()) }
}
pub fn validate_serialize_deserialize(&self) {
pub fn validate_serialize_deserialize(&mut self) {
unsafe { nir_shader_serialize_deserialize(self.nir.as_ptr()) }
}
@ -298,7 +298,7 @@ impl NirShader {
unsafe { (*self.nir.as_ptr()).info.num_textures }
}
pub fn reset_scratch_size(&self) {
pub fn reset_scratch_size(&mut self) {
unsafe {
(*self.nir.as_ptr()).scratch_size = 0;
}
@ -337,7 +337,7 @@ impl NirShader {
unsafe { (*self.nir.as_ptr()).info.num_subgroups }
}
pub fn set_workgroup_size_variable_if_zero(&self) {
pub fn set_workgroup_size_variable_if_zero(&mut self) {
let nir = self.nir.as_ptr();
unsafe {
(*nir)
@ -365,7 +365,7 @@ impl NirShader {
.filter(move |v| v.data.mode() & mode.0 != 0)
}
pub fn extract_constant_initializers(&self) {
pub fn extract_constant_initializers(&mut self) {
let nir = self.nir.as_ptr();
unsafe {
if (*nir).constant_data_size > 0 {
@ -442,7 +442,7 @@ impl NirShader {
}
pub fn add_var(
&self,
&mut self,
mode: nir_variable_mode,
glsl_type: *const glsl_type,
loc: usize,