using IdToBool = std::unordered_map<Id, bool>;
namespace {
-// True if any of prerequisites have not yet been visited.
-bool delay(const BlockSet& prereqs, const IdToBool& visited) {
+// True if any of prerequisites have not yet been visited. May add new,
+// zero-initialized, values to visited, but doesn't modify any existing values.
+bool delay(const BlockSet& prereqs, IdToBool& visited) {
return std::any_of(prereqs.begin(), prereqs.end(),
- [&visited](Id b) { return !visited.count(b); });
+ [&visited](Id b) { return !visited[b]; });
}
}
--- /dev/null
+spv.branch-return.vert
+
+Linked vertex stage:
+
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 35
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Vertex 4 "main" 8 19 34
+ Source ESSL 300
+ Name 4 "main"
+ Name 8 "gl_InstanceID"
+ Name 19 "gl_Position"
+ Name 34 "gl_VertexID"
+ Decorate 8(gl_InstanceID) BuiltIn InstanceId
+ Decorate 19(gl_Position) BuiltIn Position
+ Decorate 34(gl_VertexID) BuiltIn VertexId
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Input 6(int)
+8(gl_InstanceID): 7(ptr) Variable Input
+ 16: TypeFloat 32
+ 17: TypeVector 16(float) 4
+ 18: TypePointer Output 17(fvec4)
+ 19(gl_Position): 18(ptr) Variable Output
+ 20: 16(float) Constant 0
+ 21: 17(fvec4) ConstantComposite 20 20 20 20
+ 26: 16(float) Constant 1039918957
+ 27: TypeInt 32 0
+ 28: 27(int) Constant 0
+ 29: TypePointer Output 16(float)
+ 34(gl_VertexID): 7(ptr) Variable Input
+ 4(main): 2 Function None 3
+ 5: Label
+ 9: 6(int) Load 8(gl_InstanceID)
+ SelectionMerge 14 None
+ Switch 9 14
+ case 0: 10
+ case 1: 11
+ case 2: 12
+ case 3: 13
+ 10: Label
+ Return
+ 11: Label
+ Store 19(gl_Position) 21
+ Branch 14
+ 12: Label
+ Return
+ 13: Label
+ Return
+ 14: Label
+ 30: 29(ptr) AccessChain 19(gl_Position) 28
+ 31: 16(float) Load 30
+ 32: 16(float) FAdd 31 26
+ 33: 29(ptr) AccessChain 19(gl_Position) 28
+ Store 33 32
+ Return
+ FunctionEnd