From c87693a70031d2544cdf2312d912eacfe017aff6 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 4 Oct 2023 12:21:59 -0500 Subject: [PATCH] nak: Fix a bunch of warnings Part-of: --- src/nouveau/compiler/nak.rs | 3 +-- src/nouveau/compiler/nak_calc_instr_deps.rs | 4 ---- src/nouveau/compiler/nak_encode_sm75.rs | 4 ++-- src/nouveau/compiler/nak_from_nir.rs | 6 ++---- src/nouveau/compiler/nak_ir.rs | 2 +- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/nouveau/compiler/nak.rs b/src/nouveau/compiler/nak.rs index 186c30177c2..aa3af81a310 100644 --- a/src/nouveau/compiler/nak.rs +++ b/src/nouveau/compiler/nak.rs @@ -28,7 +28,6 @@ mod util; use crate::nak_ir::ShaderStageInfo; -use bitview::*; use nak_bindings::*; use nak_from_nir::*; use nak_ir::ShaderIoInfo; @@ -164,7 +163,7 @@ pub extern "C" fn nak_compiler_destroy(nak: *mut nak_compiler) { } #[no_mangle] -pub extern "C" fn nak_debug_flags(nak: *const nak_compiler) -> u64 { +pub extern "C" fn nak_debug_flags(_nak: *const nak_compiler) -> u64 { DEBUG.debug_flags().into() } diff --git a/src/nouveau/compiler/nak_calc_instr_deps.rs b/src/nouveau/compiler/nak_calc_instr_deps.rs index 4a88111a777..6fe1d41e3d7 100644 --- a/src/nouveau/compiler/nak_calc_instr_deps.rs +++ b/src/nouveau/compiler/nak_calc_instr_deps.rs @@ -129,10 +129,6 @@ impl BarAlloc { self.wr_bars & (1 << bar) != 0 } - pub fn is_rd_bar(&self, bar: u8) -> bool { - !self.is_wr_bar(bar) - } - pub fn get_bar(&self, dep: usize) -> Option { let bar = self.dep_bar[dep]; if bar == u8::MAX { diff --git a/src/nouveau/compiler/nak_encode_sm75.rs b/src/nouveau/compiler/nak_encode_sm75.rs index 1e7c269a018..e71573353fb 100644 --- a/src/nouveau/compiler/nak_encode_sm75.rs +++ b/src/nouveau/compiler/nak_encode_sm75.rs @@ -1708,12 +1708,12 @@ impl SM75Instr { self.set_reg_src(24..32, op.idx); } - fn encode_kill(&mut self, op: &OpKill) { + fn encode_kill(&mut self, _op: &OpKill) { self.set_opcode(0x95b); self.set_pred_src(87..90, 90, SrcRef::True.into()); } - fn encode_nop(&mut self, op: &OpNop) { + fn encode_nop(&mut self, _op: &OpNop) { self.set_opcode(0x918); } diff --git a/src/nouveau/compiler/nak_from_nir.rs b/src/nouveau/compiler/nak_from_nir.rs index 5efd60a15a5..6f96912a9dd 100644 --- a/src/nouveau/compiler/nak_from_nir.rs +++ b/src/nouveau/compiler/nak_from_nir.rs @@ -6,8 +6,6 @@ #![allow(non_upper_case_globals)] #![allow(unstable_name_collisions)] -use crate::bitset::BitSet; -use crate::bitview::{BitMutView, BitView, SetField}; use crate::nak_cfg::CFGBuilder; use crate::nak_ir::*; use crate::nak_sph::{OutputTopology, PixelImap}; @@ -1825,7 +1823,7 @@ impl<'a> ShaderFromNir<'a> { }); } nir_intrinsic_store_output => { - let ShaderIoInfo::Fragment(io) = &mut self.info.io else { + let ShaderIoInfo::Fragment(_) = &mut self.info.io else { panic!("load_input is only used for fragment shaders"); }; let data = self.get_src(&srcs[0]); @@ -2188,7 +2186,7 @@ impl<'a> ShaderFromNir<'a> { self.parse_cf_list(&mut ssa_alloc, &mut phi_map, nfi.iter_body()); - let mut cfg = std::mem::take(&mut self.cfg).as_cfg(); + let cfg = std::mem::take(&mut self.cfg).as_cfg(); assert!(cfg.len() > 0); for i in 0..cfg.len() { if cfg[i].falls_through() { diff --git a/src/nouveau/compiler/nak_ir.rs b/src/nouveau/compiler/nak_ir.rs index 586c4d0c4c8..85efe33e11f 100644 --- a/src/nouveau/compiler/nak_ir.rs +++ b/src/nouveau/compiler/nak_ir.rs @@ -5,7 +5,7 @@ extern crate nak_ir_proc; -use crate::bitview::{BitMutView, SetField}; +use crate::bitview::{BitMutView}; pub use crate::nak_builder::{ Builder, InstrBuilder, SSABuilder, SSAInstrBuilder, };