diff --git a/src/front/spv/function.rs b/src/front/spv/function.rs index 1fb0a74871..cc66d2b1d0 100644 --- a/src/front/spv/function.rs +++ b/src/front/spv/function.rs @@ -157,9 +157,6 @@ impl> super::Parser { fun.body = flow_graph.to_naga()?; - // done - self.patch_function_calls(&mut fun)?; - match self.lookup_entry_point.remove(&fun_id) { Some(ep) => { module.entry_points.push(crate::EntryPoint { diff --git a/src/front/spv/mod.rs b/src/front/spv/mod.rs index bd085a84b4..d43c5f882c 100644 --- a/src/front/spv/mod.rs +++ b/src/front/spv/mod.rs @@ -1754,6 +1754,16 @@ impl> Parser { }?; } + log::info!("Patching..."); + // patch all the function calls + for (_, fun) in module.functions.iter_mut() { + self.patch_function_calls(fun)?; + } + for ep in module.entry_points.iter_mut() { + self.patch_function_calls(&mut ep.function)?; + } + self.lookup_function.clear(); + // Check all the images and samplers to have consistent comparison property. for (handle, flags) in self.handle_sampling.drain() { if !image::patch_comparison_type(