mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
spv-in flow: fix loop
This commit is contained in:
committed by
Dzmitry Malyshau
parent
bb7105387d
commit
34c549d49d
@@ -1,4 +1,4 @@
|
||||
#![allow(dead_code)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
use super::error::Error;
|
||||
///! see https://en.wikipedia.org/wiki/Control-flow_graph
|
||||
@@ -394,19 +394,7 @@ impl FlowGraph {
|
||||
};
|
||||
Ok(result)
|
||||
}
|
||||
Some(ControlFlowNodeType::Continue) => {
|
||||
let back_block = match node.terminator {
|
||||
Terminator::Branch { target_id } => {
|
||||
self.naga_traverse(self.block_to_node[&target_id], None)?
|
||||
}
|
||||
_ => return Err(Error::InvalidTerminator),
|
||||
};
|
||||
|
||||
let mut result = node.block.clone();
|
||||
result.extend(back_block);
|
||||
result.push(crate::Statement::Continue);
|
||||
Ok(result)
|
||||
}
|
||||
Some(ControlFlowNodeType::Continue) => Ok(node.block.clone()),
|
||||
Some(ControlFlowNodeType::Back) => Ok(node.block.clone()),
|
||||
Some(ControlFlowNodeType::Kill) => {
|
||||
let mut result = node.block.clone();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
source: tests/snapshots.rs
|
||||
expression: output
|
||||
|
||||
---
|
||||
(
|
||||
functions: [
|
||||
@@ -878,7 +879,7 @@ expression: output
|
||||
control_flags: (
|
||||
bits: 1,
|
||||
),
|
||||
ref_count: 12,
|
||||
ref_count: 11,
|
||||
assignable_global: None,
|
||||
),
|
||||
(
|
||||
@@ -1214,7 +1215,7 @@ expression: output
|
||||
control_flags: (
|
||||
bits: 1,
|
||||
),
|
||||
ref_count: 2,
|
||||
ref_count: 1,
|
||||
assignable_global: None,
|
||||
),
|
||||
(
|
||||
|
||||
@@ -1107,11 +1107,6 @@ expression: output
|
||||
pointer: 43,
|
||||
value: 91,
|
||||
),
|
||||
Store(
|
||||
pointer: 44,
|
||||
value: 92,
|
||||
),
|
||||
Continue,
|
||||
],
|
||||
continuing: [
|
||||
Store(
|
||||
|
||||
Reference in New Issue
Block a user