mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[spv-in] defer function call patching to the end of the module
This commit is contained in:
committed by
Dzmitry Malyshau
parent
d433ee81e6
commit
7c26320cce
@@ -157,9 +157,6 @@ impl<I: Iterator<Item = u32>> super::Parser<I> {
|
||||
|
||||
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 {
|
||||
|
||||
@@ -1754,6 +1754,16 @@ impl<I: Iterator<Item = u32>> Parser<I> {
|
||||
}?;
|
||||
}
|
||||
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user