Merge pull request #1232 from KhronosGroup/control-flow-attributes

Control flow attributes
This commit is contained in:
John Kessenich
2018-02-02 09:03:44 -07:00
committed by GitHub
42 changed files with 3765 additions and 2890 deletions

View File

@@ -1,6 +1,14 @@
460.frag
ERROR: 0:22: 'attribute' : required extension not requested: GL_EXT_control_flow_attributes
ERROR: 0:23: 'attribute' : required extension not requested: GL_EXT_control_flow_attributes
ERROR: 0:30: 'dependency_length' : must be positive
ERROR: 0:31: 'dependency_length' : must be positive
ERROR: 4 compilation errors. No code generated.
Shader version: 460
0:? Sequence
Requested GL_EXT_control_flow_attributes
ERROR: node is still EOpNull!
0:10 Function Definition: main( ( global void)
0:10 Function Parameters:
0:12 Sequence
@@ -21,6 +29,43 @@ Shader version: 460
0:16 'b1' ( temp bool)
0:16 allInvocationsEqual ( global bool)
0:16 'b1' ( temp bool)
0:19 Function Definition: attExtBad( ( global void)
0:19 Function Parameters:
0:22 Sequence
0:22 Sequence
0:22 Sequence
0:22 move second child to first child ( temp int)
0:22 'i' ( temp int)
0:22 Constant:
0:22 0 (const int)
0:22 Loop with condition tested first: Dependency 4
0:22 Loop Condition
0:22 Compare Less Than ( temp bool)
0:22 'i' ( temp int)
0:22 Constant:
0:22 8 (const int)
0:22 No loop body
0:22 Loop Terminal Expression
0:22 Pre-Increment ( temp int)
0:22 'i' ( temp int)
0:23 Test condition and select ( temp void): Flatten
0:23 Condition
0:23 Constant:
0:23 true (const bool)
0:23 true case is null
0:28 Function Definition: attExt( ( global void)
0:28 Function Parameters:
0:30 Sequence
0:30 Loop with condition not tested first: Dependency -3
0:30 Loop Condition
0:30 Constant:
0:30 true (const bool)
0:30 No loop body
0:31 Loop with condition not tested first
0:31 Loop Condition
0:31 Constant:
0:31 true (const bool)
0:31 No loop body
0:? Linker Objects
0:? 's' ( smooth in structure{ global float f, global 4-component vector of float v})
@@ -29,7 +74,8 @@ Linked fragment stage:
Shader version: 460
0:? Sequence
Requested GL_EXT_control_flow_attributes
ERROR: node is still EOpNull!
0:10 Function Definition: main( ( global void)
0:10 Function Parameters:
0:12 Sequence

View File

@@ -10,7 +10,7 @@ local_size = (4, 6, 8)
0:11 'x' ( temp int)
0:11 Constant:
0:11 0 (const int)
0:11 Loop with condition tested first
0:11 Loop with condition tested first: Unroll
0:11 Loop Condition
0:11 Compare Less Than ( temp bool)
0:11 'x' ( temp int)
@@ -53,7 +53,7 @@ local_size = (4, 6, 8)
0:11 'x' ( temp int)
0:11 Constant:
0:11 0 (const int)
0:11 Loop with condition tested first
0:11 Loop with condition tested first: Unroll
0:11 Loop Condition
0:11 Compare Less Than ( temp bool)
0:11 'x' ( temp int)

View File

@@ -6,7 +6,7 @@ gl_FragCoord origin is upper left
0:2 Function Parameters:
0:2 'input' ( in 4-component vector of float)
0:? Sequence
0:11 Test condition and select ( temp void)
0:11 Test condition and select ( temp void): DontFlatten
0:11 Condition
0:11 Constant:
0:11 false (const bool)
@@ -33,7 +33,7 @@ gl_FragCoord origin is upper left
0:2 Function Parameters:
0:2 'input' ( in 4-component vector of float)
0:? Sequence
0:11 Test condition and select ( temp void)
0:11 Test condition and select ( temp void): DontFlatten
0:11 Condition
0:11 Constant:
0:11 false (const bool)

View File

@@ -6,12 +6,12 @@ gl_FragCoord origin is upper left
0:2 Function Parameters:
0:2 'input' ( in float)
0:? Sequence
0:3 Loop with condition not tested first
0:3 Loop with condition not tested first: Unroll
0:3 Loop Condition
0:3 Constant:
0:3 false (const bool)
0:3 No loop body
0:4 Loop with condition not tested first
0:4 Loop with condition not tested first: Unroll
0:4 Loop Condition
0:4 Constant:
0:4 false (const bool)
@@ -80,12 +80,12 @@ gl_FragCoord origin is upper left
0:2 Function Parameters:
0:2 'input' ( in float)
0:? Sequence
0:3 Loop with condition not tested first
0:3 Loop with condition not tested first: Unroll
0:3 Loop Condition
0:3 Constant:
0:3 false (const bool)
0:3 No loop body
0:4 Loop with condition not tested first
0:4 Loop with condition not tested first: Unroll
0:4 Loop Condition
0:4 Constant:
0:4 false (const bool)

View File

@@ -17,7 +17,7 @@ gl_FragCoord origin is upper left
0:4 No loop condition
0:4 No loop body
0:? Sequence
0:5 Loop with condition tested first
0:5 Loop with condition tested first: Unroll
0:5 Loop Condition
0:5 any ( temp bool)
0:5 NotEqual ( temp 4-component vector of bool)
@@ -220,7 +220,7 @@ gl_FragCoord origin is upper left
0:4 No loop condition
0:4 No loop body
0:? Sequence
0:5 Loop with condition tested first
0:5 Loop with condition tested first: Unroll
0:5 Loop Condition
0:5 any ( temp bool)
0:5 NotEqual ( temp 4-component vector of bool)

View File

@@ -42,7 +42,7 @@ gl_FragCoord origin is upper left
0:14 'input' ( in 4-component vector of float)
0:14 'input' ( in 4-component vector of float)
0:14 true case is null
0:19 Test condition and select ( temp void)
0:19 Test condition and select ( temp void): Flatten
0:19 Condition
0:19 all ( temp bool)
0:19 Equal ( temp 4-component vector of bool)
@@ -152,7 +152,7 @@ gl_FragCoord origin is upper left
0:14 'input' ( in 4-component vector of float)
0:14 'input' ( in 4-component vector of float)
0:14 true case is null
0:19 Test condition and select ( temp void)
0:19 Test condition and select ( temp void): Flatten
0:19 Condition
0:19 all ( temp bool)
0:19 Equal ( temp 4-component vector of bool)

View File

@@ -10,7 +10,7 @@ gl_FragCoord origin is upper left
0:5 'x' ( temp int)
0:5 Constant:
0:5 0 (const int)
0:5 Loop with condition tested first
0:5 Loop with condition tested first: Unroll
0:5 Loop Condition
0:5 Compare Less Than ( temp bool)
0:5 'x' ( temp int)
@@ -25,7 +25,7 @@ gl_FragCoord origin is upper left
0:8 'y' ( temp int)
0:8 Constant:
0:8 0 (const int)
0:8 Loop with condition tested first
0:8 Loop with condition tested first: DontUnroll
0:8 Loop Condition
0:8 Compare Less Than ( temp bool)
0:8 'y' ( temp int)
@@ -80,7 +80,7 @@ gl_FragCoord origin is upper left
0:5 'x' ( temp int)
0:5 Constant:
0:5 0 (const int)
0:5 Loop with condition tested first
0:5 Loop with condition tested first: Unroll
0:5 Loop Condition
0:5 Compare Less Than ( temp bool)
0:5 'x' ( temp int)
@@ -95,7 +95,7 @@ gl_FragCoord origin is upper left
0:8 'y' ( temp int)
0:8 Constant:
0:8 0 (const int)
0:8 Loop with condition tested first
0:8 Loop with condition tested first: DontUnroll
0:8 Loop Condition
0:8 Compare Less Than ( temp bool)
0:8 'y' ( temp int)

View File

@@ -1,20 +1,20 @@
hlsl.numthreads.comp
Shader version: 500
local_size = (4, 4, 2)
local_size = (1, 4, 8)
0:? Sequence
0:4 Function Definition: main(vu3; ( temp void)
0:4 Function Parameters:
0:4 'tid' ( in 3-component vector of uint)
0:9 Function Definition: @main_aux1(vu3; ( temp void)
0:9 Function Definition: @main_aux2(vu3; ( temp void)
0:9 Function Parameters:
0:9 'tid' ( in 3-component vector of uint)
0:9 Function Definition: main_aux1( ( temp void)
0:9 Function Definition: main_aux2( ( temp void)
0:9 Function Parameters:
0:? Sequence
0:9 move second child to first child ( temp 3-component vector of uint)
0:? 'tid' ( temp 3-component vector of uint)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
0:9 Function Call: @main_aux1(vu3; ( temp void)
0:9 Function Call: @main_aux2(vu3; ( temp void)
0:? 'tid' ( temp 3-component vector of uint)
0:? Linker Objects
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
@@ -24,21 +24,21 @@ Linked compute stage:
Shader version: 500
local_size = (4, 4, 2)
local_size = (1, 4, 8)
0:? Sequence
0:4 Function Definition: main(vu3; ( temp void)
0:4 Function Parameters:
0:4 'tid' ( in 3-component vector of uint)
0:9 Function Definition: @main_aux1(vu3; ( temp void)
0:9 Function Definition: @main_aux2(vu3; ( temp void)
0:9 Function Parameters:
0:9 'tid' ( in 3-component vector of uint)
0:9 Function Definition: main_aux1( ( temp void)
0:9 Function Definition: main_aux2( ( temp void)
0:9 Function Parameters:
0:? Sequence
0:9 move second child to first child ( temp 3-component vector of uint)
0:? 'tid' ( temp 3-component vector of uint)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
0:9 Function Call: @main_aux1(vu3; ( temp void)
0:9 Function Call: @main_aux2(vu3; ( temp void)
0:? 'tid' ( temp 3-component vector of uint)
0:? Linker Objects
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
@@ -50,13 +50,13 @@ local_size = (4, 4, 2)
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main_aux1" 18
ExecutionMode 4 LocalSize 4 4 2
EntryPoint GLCompute 4 "main_aux2" 18
ExecutionMode 4 LocalSize 1 4 8
Source HLSL 500
Name 4 "main_aux1"
Name 4 "main_aux2"
Name 11 "main(vu3;"
Name 10 "tid"
Name 14 "@main_aux1(vu3;"
Name 14 "@main_aux2(vu3;"
Name 13 "tid"
Name 16 "tid"
Name 18 "tid"
@@ -70,7 +70,7 @@ local_size = (4, 4, 2)
9: TypeFunction 2 8(ptr)
17: TypePointer Input 7(ivec3)
18(tid): 17(ptr) Variable Input
4(main_aux1): 2 Function None 3
4(main_aux2): 2 Function None 3
5: Label
16(tid): 8(ptr) Variable Function
20(param): 8(ptr) Variable Function
@@ -78,7 +78,7 @@ local_size = (4, 4, 2)
Store 16(tid) 19
21: 7(ivec3) Load 16(tid)
Store 20(param) 21
22: 2 FunctionCall 14(@main_aux1(vu3;) 20(param)
22: 2 FunctionCall 14(@main_aux2(vu3;) 20(param)
Return
FunctionEnd
11(main(vu3;): 2 Function None 9
@@ -86,7 +86,7 @@ local_size = (4, 4, 2)
12: Label
Return
FunctionEnd
14(@main_aux1(vu3;): 2 Function None 9
14(@main_aux2(vu3;): 2 Function None 9
13(tid): 8(ptr) FunctionParameter
15: Label
Return

View File

@@ -36,7 +36,7 @@ gl_FragCoord origin is upper left
0:17 Pre-Decrement ( temp 4-component vector of float)
0:17 'input' ( in 4-component vector of float)
0:18 Branch: Break
0:21 switch
0:21 switch: DontFlatten
0:21 condition
0:21 'c' ( in int)
0:21 body
@@ -186,7 +186,7 @@ gl_FragCoord origin is upper left
0:17 Pre-Decrement ( temp 4-component vector of float)
0:17 'input' ( in 4-component vector of float)
0:18 Branch: Break
0:21 switch
0:21 switch: DontFlatten
0:21 condition
0:21 'c' ( in int)
0:21 body

View File

@@ -21,7 +21,7 @@ gl_FragCoord origin is upper left
0:4 Constant:
0:4 false (const bool)
0:4 No loop body
0:5 Loop with condition tested first
0:5 Loop with condition tested first: Unroll
0:5 Loop Condition
0:5 Constant:
0:5 false (const bool)
@@ -71,7 +71,7 @@ gl_FragCoord origin is upper left
0:4 Constant:
0:4 false (const bool)
0:4 No loop body
0:5 Loop with condition tested first
0:5 Loop with condition tested first: Unroll
0:5 Loop Condition
0:5 Constant:
0:5 false (const bool)

View File

@@ -0,0 +1,238 @@
spv.controlFlowAttributes.frag
WARNING: 0:20: '' : attribute with arguments not recognized, skipping
WARNING: 0:21: '' : attribute with arguments not recognized, skipping
WARNING: 0:22: '' : attribute with arguments not recognized, skipping
WARNING: 0:23: 'dependency_length' : expected a single integer argument
WARNING: 0:24: '' : attribute with arguments not recognized, skipping
WARNING: 0:25: '' : attribute with arguments not recognized, skipping
WARNING: 0:26: '' : attribute with arguments not recognized, skipping
// Module Version 10000
// Generated by (magic number): 80003
// Id's are bound by 118
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_EXT_control_flow_attributes"
Name 4 "main"
Name 8 "i"
Name 36 "i"
Name 47 "cond"
Name 60 "i"
Name 79 "i"
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Function 6(int)
9: 6(int) Constant 0
16: 6(int) Constant 8
17: TypeBool
20: 6(int) Constant 1
31: 17(bool) ConstantTrue
46: TypePointer Private 17(bool)
47(cond): 46(ptr) Variable Private
54: 17(bool) ConstantFalse
55: 6(int) Constant 3
4(main): 2 Function None 3
5: Label
8(i): 7(ptr) Variable Function
36(i): 7(ptr) Variable Function
60(i): 7(ptr) Variable Function
79(i): 7(ptr) Variable Function
Store 8(i) 9
Branch 10
10: Label
LoopMerge 12 13 Unroll
Branch 14
14: Label
15: 6(int) Load 8(i)
18: 17(bool) SLessThan 15 16
BranchConditional 18 11 12
11: Label
Branch 13
13: Label
19: 6(int) Load 8(i)
21: 6(int) IAdd 19 20
Store 8(i) 21
Branch 10
12: Label
Branch 22
22: Label
LoopMerge 24 25 DontUnroll
Branch 23
23: Label
Branch 25
25: Label
Branch 22
24: Label
Branch 26
26: Label
LoopMerge 28 29 DontUnroll
Branch 30
30: Label
BranchConditional 31 27 28
27: Label
Branch 29
29: Label
Branch 26
28: Label
Branch 32
32: Label
LoopMerge 34 35 DependencyInfinite
Branch 33
33: Label
Branch 35
35: Label
BranchConditional 31 32 34
34: Label
Store 36(i) 9
Branch 37
37: Label
LoopMerge 39 40 DependencyLength 4
Branch 41
41: Label
42: 6(int) Load 36(i)
43: 17(bool) SLessThan 42 16
BranchConditional 43 38 39
38: Label
Branch 40
40: Label
44: 6(int) Load 36(i)
45: 6(int) IAdd 44 20
Store 36(i) 45
Branch 37
39: Label
48: 17(bool) Load 47(cond)
SelectionMerge 50 Flatten
BranchConditional 48 49 50
49: Label
Branch 50
50: Label
51: 17(bool) Load 47(cond)
SelectionMerge 53 DontFlatten
BranchConditional 51 52 53
52: Label
Store 47(cond) 54
Branch 53
53: Label
SelectionMerge 57 DontFlatten
Switch 55 57
case 3: 56
56: Label
Branch 57
57: Label
Store 60(i) 9
Branch 61
61: Label
LoopMerge 63 64 None
Branch 65
65: Label
66: 6(int) Load 60(i)
67: 17(bool) SLessThan 66 16
BranchConditional 67 62 63
62: Label
Branch 64
64: Label
68: 6(int) Load 60(i)
69: 6(int) IAdd 68 20
Store 60(i) 69
Branch 61
63: Label
Branch 70
70: Label
LoopMerge 72 73 None
Branch 74
74: Label
BranchConditional 31 71 72
71: Label
Branch 73
73: Label
Branch 70
72: Label
Branch 75
75: Label
LoopMerge 77 78 None
Branch 76
76: Label
Branch 78
78: Label
BranchConditional 31 75 77
77: Label
Store 79(i) 9
Branch 80
80: Label
LoopMerge 82 83 None
Branch 84
84: Label
85: 6(int) Load 79(i)
86: 17(bool) SLessThan 85 16
BranchConditional 86 81 82
81: Label
Branch 83
83: Label
87: 6(int) Load 79(i)
88: 6(int) IAdd 87 20
Store 79(i) 88
Branch 80
82: Label
89: 17(bool) Load 47(cond)
SelectionMerge 91 None
BranchConditional 89 90 91
90: Label
Branch 91
91: Label
92: 17(bool) Load 47(cond)
SelectionMerge 94 None
BranchConditional 92 93 94
93: Label
Store 47(cond) 54
Branch 94
94: Label
SelectionMerge 96 None
Switch 55 96
case 3: 95
95: Label
Branch 96
96: Label
Branch 99
99: Label
LoopMerge 101 102 Unroll DontUnroll DependencyLength 2
Branch 103
103: Label
104: 17(bool) Load 47(cond)
BranchConditional 104 100 101
100: Label
Branch 102
102: Label
Branch 99
101: Label
SelectionMerge 106 DontFlatten
Switch 55 106
case 3: 105
105: Label
Branch 106
106: Label
109: 17(bool) Load 47(cond)
SelectionMerge 111 Flatten
BranchConditional 109 110 111
110: Label
Branch 111
111: Label
Branch 112
112: Label
LoopMerge 114 115 DependencyInfinite
Branch 116
116: Label
117: 17(bool) Load 47(cond)
BranchConditional 117 113 114
113: Label
Branch 115
115: Label
Branch 112
114: Label
Return
FunctionEnd