mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
spv-in: fix if branches in CFG
format
This commit is contained in:
committed by
Dzmitry Malyshau
parent
7c2f4eac2e
commit
53f7f9de92
@@ -251,12 +251,21 @@ impl FlowGraph {
|
||||
reject: self.naga_traverse(false_node_index, Some(merge_node_index))?,
|
||||
});
|
||||
} else {
|
||||
let true_merges_to_false = has_path_connecting(
|
||||
&self.flow,
|
||||
true_node_index,
|
||||
false_node_index,
|
||||
None,
|
||||
);
|
||||
let stop_node_index = if true_merges_to_false {
|
||||
Some(merge_node_index)
|
||||
} else {
|
||||
stop_node_index
|
||||
};
|
||||
|
||||
result.push(crate::Statement::If {
|
||||
condition,
|
||||
accept: self.naga_traverse(
|
||||
self.block_to_node[&true_id],
|
||||
Some(merge_node_index),
|
||||
)?,
|
||||
accept: self.naga_traverse(true_node_index, stop_node_index)?,
|
||||
reject: vec![],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user