Split loop header from condition testing for for/while loops.

This commit is contained in:
Dejan Mircevski 2016-01-20 11:51:43 -05:00
parent 7349eab099
commit 213bbbe4a7
14 changed files with 1905 additions and 1828 deletions

View file

@ -5,30 +5,30 @@ Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 127
// Id's are bound by 132
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 36 101
EntryPoint Fragment 4 "main" 11 37 105
ExecutionMode 4 OriginLowerLeft
Source GLSL 130
Name 4 "main"
Name 9 "color"
Name 11 "BaseColor"
Name 15 "i"
Name 23 "Count"
Name 28 "bigColor"
Name 36 "gl_FragColor"
Name 39 "sum"
Name 41 "i"
Name 52 "v4"
Name 62 "i"
Name 69 "tv4"
Name 86 "r"
Name 92 "i"
Name 101 "f"
Name 114 "i"
Name 24 "Count"
Name 29 "bigColor"
Name 37 "gl_FragColor"
Name 40 "sum"
Name 42 "i"
Name 54 "v4"
Name 64 "i"
Name 72 "tv4"
Name 89 "r"
Name 95 "i"
Name 105 "f"
Name 118 "i"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -39,166 +39,176 @@ Linked fragment stage:
13: TypeInt 32 1
14: TypePointer Function 13(int)
16: 13(int) Constant 0
22: TypePointer UniformConstant 13(int)
23(Count): 22(ptr) Variable UniformConstant
25: TypeBool
27: TypePointer UniformConstant 7(fvec4)
28(bigColor): 27(ptr) Variable UniformConstant
33: 13(int) Constant 1
35: TypePointer Output 7(fvec4)
36(gl_FragColor): 35(ptr) Variable Output
38: TypePointer Function 6(float)
40: 6(float) Constant 0
47: 13(int) Constant 4
49: TypeInt 32 0
50: TypeVector 49(int) 4
51: TypePointer UniformConstant 50(ivec4)
52(v4): 51(ptr) Variable UniformConstant
54: TypePointer UniformConstant 49(int)
74: 49(int) Constant 4
87: TypeVector 6(float) 3
100: TypePointer Input 6(float)
101(f): 100(ptr) Variable Input
103: 49(int) Constant 3
120: 13(int) Constant 16
23: TypePointer UniformConstant 13(int)
24(Count): 23(ptr) Variable UniformConstant
26: TypeBool
28: TypePointer UniformConstant 7(fvec4)
29(bigColor): 28(ptr) Variable UniformConstant
34: 13(int) Constant 1
36: TypePointer Output 7(fvec4)
37(gl_FragColor): 36(ptr) Variable Output
39: TypePointer Function 6(float)
41: 6(float) Constant 0
49: 13(int) Constant 4
51: TypeInt 32 0
52: TypeVector 51(int) 4
53: TypePointer UniformConstant 52(ivec4)
54(v4): 53(ptr) Variable UniformConstant
56: TypePointer UniformConstant 51(int)
77: 51(int) Constant 4
90: TypeVector 6(float) 3
104: TypePointer Input 6(float)
105(f): 104(ptr) Variable Input
107: 51(int) Constant 3
125: 13(int) Constant 16
4(main): 2 Function None 3
5: Label
9(color): 8(ptr) Variable Function
15(i): 14(ptr) Variable Function
39(sum): 38(ptr) Variable Function
41(i): 14(ptr) Variable Function
62(i): 14(ptr) Variable Function
69(tv4): 8(ptr) Variable Function
86(r): 8(ptr) Variable Function
92(i): 14(ptr) Variable Function
114(i): 14(ptr) Variable Function
40(sum): 39(ptr) Variable Function
42(i): 14(ptr) Variable Function
64(i): 14(ptr) Variable Function
72(tv4): 8(ptr) Variable Function
89(r): 8(ptr) Variable Function
95(i): 14(ptr) Variable Function
118(i): 14(ptr) Variable Function
12: 7(fvec4) Load 11(BaseColor)
Store 9(color) 12
Store 15(i) 16
Branch 17
17: Label
21: 13(int) Load 15(i)
24: 13(int) Load 23(Count)
26: 25(bool) SLessThan 21 24
LoopMerge 19 20 None
BranchConditional 26 18 19
Branch 21
21: Label
22: 13(int) Load 15(i)
25: 13(int) Load 24(Count)
27: 26(bool) SLessThan 22 25
BranchConditional 27 18 19
18: Label
29: 7(fvec4) Load 28(bigColor)
30: 7(fvec4) Load 9(color)
31: 7(fvec4) FAdd 30 29
Store 9(color) 31
30: 7(fvec4) Load 29(bigColor)
31: 7(fvec4) Load 9(color)
32: 7(fvec4) FAdd 31 30
Store 9(color) 32
Branch 20
20: Label
32: 13(int) Load 15(i)
34: 13(int) IAdd 32 33
Store 15(i) 34
33: 13(int) Load 15(i)
35: 13(int) IAdd 33 34
Store 15(i) 35
Branch 17
19: Label
37: 7(fvec4) Load 9(color)
Store 36(gl_FragColor) 37
Store 39(sum) 40
Store 41(i) 16
Branch 42
42: Label
46: 13(int) Load 41(i)
48: 25(bool) SLessThan 46 47
LoopMerge 44 45 None
BranchConditional 48 43 44
43: Label
53: 13(int) Load 41(i)
55: 54(ptr) AccessChain 52(v4) 53
56: 49(int) Load 55
57: 6(float) ConvertUToF 56
58: 6(float) Load 39(sum)
59: 6(float) FAdd 58 57
Store 39(sum) 59
Branch 45
45: Label
60: 13(int) Load 41(i)
61: 13(int) IAdd 60 33
Store 41(i) 61
Branch 42
44: Label
Store 62(i) 16
Branch 63
63: Label
67: 13(int) Load 62(i)
68: 25(bool) SLessThan 67 47
LoopMerge 65 66 None
BranchConditional 68 64 65
64: Label
70: 13(int) Load 62(i)
71: 13(int) Load 62(i)
72: 54(ptr) AccessChain 52(v4) 71
73: 49(int) Load 72
75: 49(int) IMul 73 74
76: 6(float) ConvertUToF 75
77: 38(ptr) AccessChain 69(tv4) 70
Store 77 76
Branch 66
66: Label
78: 13(int) Load 62(i)
79: 13(int) IAdd 78 33
Store 62(i) 79
Branch 63
38: 7(fvec4) Load 9(color)
Store 37(gl_FragColor) 38
Store 40(sum) 41
Store 42(i) 16
Branch 43
43: Label
LoopMerge 45 46 None
Branch 47
47: Label
48: 13(int) Load 42(i)
50: 26(bool) SLessThan 48 49
BranchConditional 50 44 45
44: Label
55: 13(int) Load 42(i)
57: 56(ptr) AccessChain 54(v4) 55
58: 51(int) Load 57
59: 6(float) ConvertUToF 58
60: 6(float) Load 40(sum)
61: 6(float) FAdd 60 59
Store 40(sum) 61
Branch 46
46: Label
62: 13(int) Load 42(i)
63: 13(int) IAdd 62 34
Store 42(i) 63
Branch 43
45: Label
Store 64(i) 16
Branch 65
65: Label
80: 6(float) Load 39(sum)
81: 7(fvec4) CompositeConstruct 80 80 80 80
82: 7(fvec4) Load 69(tv4)
83: 7(fvec4) FAdd 81 82
84: 7(fvec4) Load 36(gl_FragColor)
85: 7(fvec4) FAdd 84 83
Store 36(gl_FragColor) 85
88: 7(fvec4) Load 11(BaseColor)
89: 87(fvec3) VectorShuffle 88 88 0 1 2
90: 7(fvec4) Load 86(r)
91: 7(fvec4) VectorShuffle 90 89 4 5 6 3
Store 86(r) 91
Store 92(i) 16
Branch 93
93: Label
97: 13(int) Load 92(i)
98: 13(int) Load 23(Count)
99: 25(bool) SLessThan 97 98
LoopMerge 95 96 None
BranchConditional 99 94 95
94: Label
102: 6(float) Load 101(f)
104: 38(ptr) AccessChain 86(r) 103
Store 104 102
LoopMerge 67 68 None
Branch 69
69: Label
70: 13(int) Load 64(i)
71: 26(bool) SLessThan 70 49
BranchConditional 71 66 67
66: Label
73: 13(int) Load 64(i)
74: 13(int) Load 64(i)
75: 56(ptr) AccessChain 54(v4) 74
76: 51(int) Load 75
78: 51(int) IMul 76 77
79: 6(float) ConvertUToF 78
80: 39(ptr) AccessChain 72(tv4) 73
Store 80 79
Branch 68
68: Label
81: 13(int) Load 64(i)
82: 13(int) IAdd 81 34
Store 64(i) 82
Branch 65
67: Label
83: 6(float) Load 40(sum)
84: 7(fvec4) CompositeConstruct 83 83 83 83
85: 7(fvec4) Load 72(tv4)
86: 7(fvec4) FAdd 84 85
87: 7(fvec4) Load 37(gl_FragColor)
88: 7(fvec4) FAdd 87 86
Store 37(gl_FragColor) 88
91: 7(fvec4) Load 11(BaseColor)
92: 90(fvec3) VectorShuffle 91 91 0 1 2
93: 7(fvec4) Load 89(r)
94: 7(fvec4) VectorShuffle 93 92 4 5 6 3
Store 89(r) 94
Store 95(i) 16
Branch 96
96: Label
LoopMerge 98 99 None
Branch 100
100: Label
101: 13(int) Load 95(i)
102: 13(int) Load 24(Count)
103: 26(bool) SLessThan 101 102
BranchConditional 103 97 98
97: Label
106: 6(float) Load 105(f)
108: 39(ptr) AccessChain 89(r) 107
Store 108 106
Branch 99
99: Label
109: 13(int) Load 95(i)
110: 13(int) IAdd 109 34
Store 95(i) 110
Branch 96
96: Label
105: 13(int) Load 92(i)
106: 13(int) IAdd 105 33
Store 92(i) 106
Branch 93
95: Label
107: 7(fvec4) Load 86(r)
108: 87(fvec3) VectorShuffle 107 107 0 1 2
109: 7(fvec4) Load 36(gl_FragColor)
110: 87(fvec3) VectorShuffle 109 109 0 1 2
111: 87(fvec3) FAdd 110 108
112: 7(fvec4) Load 36(gl_FragColor)
113: 7(fvec4) VectorShuffle 112 111 4 5 6 3
Store 36(gl_FragColor) 113
Store 114(i) 16
Branch 115
115: Label
119: 13(int) Load 114(i)
121: 25(bool) SLessThan 119 120
LoopMerge 117 118 None
BranchConditional 121 116 117
116: Label
122: 6(float) Load 101(f)
123: 7(fvec4) Load 36(gl_FragColor)
124: 7(fvec4) VectorTimesScalar 123 122
Store 36(gl_FragColor) 124
Branch 118
118: Label
125: 13(int) Load 114(i)
126: 13(int) IAdd 125 47
Store 114(i) 126
Branch 115
117: Label
98: Label
111: 7(fvec4) Load 89(r)
112: 90(fvec3) VectorShuffle 111 111 0 1 2
113: 7(fvec4) Load 37(gl_FragColor)
114: 90(fvec3) VectorShuffle 113 113 0 1 2
115: 90(fvec3) FAdd 114 112
116: 7(fvec4) Load 37(gl_FragColor)
117: 7(fvec4) VectorShuffle 116 115 4 5 6 3
Store 37(gl_FragColor) 117
Store 118(i) 16
Branch 119
119: Label
LoopMerge 121 122 None
Branch 123
123: Label
124: 13(int) Load 118(i)
126: 26(bool) SLessThan 124 125
BranchConditional 126 120 121
120: Label
127: 6(float) Load 105(f)
128: 7(fvec4) Load 37(gl_FragColor)
129: 7(fvec4) VectorTimesScalar 128 127
Store 37(gl_FragColor) 129
Branch 122
122: Label
130: 13(int) Load 118(i)
131: 13(int) IAdd 130 49
Store 118(i) 131
Branch 119
121: Label
Return
FunctionEnd