diff --git a/src/nouveau/compiler/nak_ir.rs b/src/nouveau/compiler/nak_ir.rs index 1b589e80dc3..b710911aa5b 100644 --- a/src/nouveau/compiler/nak_ir.rs +++ b/src/nouveau/compiler/nak_ir.rs @@ -4484,6 +4484,16 @@ pub struct Shader { } impl Shader { + pub fn for_each_instr(&self, f: &mut impl FnMut(&Instr)) { + for func in &self.functions { + for b in &func.blocks { + for i in &b.instrs { + f(i); + } + } + } + } + pub fn map_instrs( &mut self, mut map: impl FnMut(Box, &mut SSAValueAllocator) -> MappedInstrs,