SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl).

This commit is contained in:
John Kessenich
2016-02-15 20:58:50 -07:00
parent 019f08fcd8
commit 6c292d3ba7
200 changed files with 7841 additions and 5577 deletions

View File

@@ -5,13 +5,13 @@ Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 268
// Id's are bound by 260
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 94 104 114 124 134 144 154 164 168
ExecutionMode 4 OriginLowerLeft
EntryPoint Fragment 4 "main" 91 93 100 102 109 111 118 120 127 129 136 138 145 147 154 156 160
ExecutionMode 4 OriginUpperLeft
Source GLSL 140
Name 4 "main"
Name 8 "b"
@@ -28,112 +28,108 @@ Linked fragment stage:
Name 64 "i_b4"
Name 89 "i"
Name 91 "u_i"
Name 94 "i_i"
Name 99 "i2"
Name 101 "u_i2"
Name 104 "i_i2"
Name 109 "i3"
Name 111 "u_i3"
Name 114 "i_i3"
Name 119 "i4"
Name 121 "u_i4"
Name 124 "i_i4"
Name 129 "f"
Name 131 "u_f"
Name 134 "i_f"
Name 139 "f2"
Name 141 "u_f2"
Name 144 "i_f2"
Name 149 "f3"
Name 151 "u_f3"
Name 154 "i_f3"
Name 159 "f4"
Name 161 "u_f4"
Name 164 "i_f4"
Name 168 "gl_FragColor"
Decorate 94(i_i) Flat
Decorate 104(i_i2) Flat
Decorate 114(i_i3) Flat
Decorate 124(i_i4) Flat
Name 93 "i_i"
Name 98 "i2"
Name 100 "u_i2"
Name 102 "i_i2"
Name 107 "i3"
Name 109 "u_i3"
Name 111 "i_i3"
Name 116 "i4"
Name 118 "u_i4"
Name 120 "i_i4"
Name 125 "f"
Name 127 "u_f"
Name 129 "i_f"
Name 134 "f2"
Name 136 "u_f2"
Name 138 "i_f2"
Name 143 "f3"
Name 145 "u_f3"
Name 147 "i_f3"
Name 152 "f4"
Name 154 "u_f4"
Name 156 "i_f4"
Name 160 "gl_FragColor"
Decorate 91(u_i) Flat
Decorate 93(i_i) Flat
Decorate 100(u_i2) Flat
Decorate 102(i_i2) Flat
Decorate 109(u_i3) Flat
Decorate 111(i_i3) Flat
Decorate 118(u_i4) Flat
Decorate 120(i_i4) Flat
2: TypeVoid
3: TypeFunction 2
6: TypeBool
7: TypePointer Function 6(bool)
9: TypePointer UniformConstant 6(bool)
10(u_b): 9(ptr) Variable UniformConstant
12(i_b): 9(ptr) Variable UniformConstant
9: TypePointer Private 6(bool)
10(u_b): 9(ptr) Variable Private
12(i_b): 9(ptr) Variable Private
15: TypeVector 6(bool) 2
16: TypePointer Function 15(bvec2)
18: TypePointer UniformConstant 15(bvec2)
19(u_b2): 18(ptr) Variable UniformConstant
22(i_b2): 18(ptr) Variable UniformConstant
18: TypePointer Private 15(bvec2)
19(u_b2): 18(ptr) Variable Private
22(i_b2): 18(ptr) Variable Private
33: TypeVector 6(bool) 3
34: TypePointer Function 33(bvec3)
36: TypePointer UniformConstant 33(bvec3)
37(u_b3): 36(ptr) Variable UniformConstant
40(i_b3): 36(ptr) Variable UniformConstant
36: TypePointer Private 33(bvec3)
37(u_b3): 36(ptr) Variable Private
40(i_b3): 36(ptr) Variable Private
57: TypeVector 6(bool) 4
58: TypePointer Function 57(bvec4)
60: TypePointer UniformConstant 57(bvec4)
61(u_b4): 60(ptr) Variable UniformConstant
64(i_b4): 60(ptr) Variable UniformConstant
60: TypePointer Private 57(bvec4)
61(u_b4): 60(ptr) Variable Private
64(i_b4): 60(ptr) Variable Private
87: TypeInt 32 1
88: TypePointer Function 87(int)
90: TypePointer UniformConstant 87(int)
91(u_i): 90(ptr) Variable UniformConstant
93: TypePointer Input 87(int)
94(i_i): 93(ptr) Variable Input
97: TypeVector 87(int) 2
98: TypePointer Function 97(ivec2)
100: TypePointer UniformConstant 97(ivec2)
101(u_i2): 100(ptr) Variable UniformConstant
103: TypePointer Input 97(ivec2)
104(i_i2): 103(ptr) Variable Input
107: TypeVector 87(int) 3
108: TypePointer Function 107(ivec3)
110: TypePointer UniformConstant 107(ivec3)
111(u_i3): 110(ptr) Variable UniformConstant
113: TypePointer Input 107(ivec3)
114(i_i3): 113(ptr) Variable Input
117: TypeVector 87(int) 4
118: TypePointer Function 117(ivec4)
120: TypePointer UniformConstant 117(ivec4)
121(u_i4): 120(ptr) Variable UniformConstant
123: TypePointer Input 117(ivec4)
124(i_i4): 123(ptr) Variable Input
127: TypeFloat 32
128: TypePointer Function 127(float)
130: TypePointer UniformConstant 127(float)
131(u_f): 130(ptr) Variable UniformConstant
133: TypePointer Input 127(float)
134(i_f): 133(ptr) Variable Input
137: TypeVector 127(float) 2
138: TypePointer Function 137(fvec2)
140: TypePointer UniformConstant 137(fvec2)
141(u_f2): 140(ptr) Variable UniformConstant
143: TypePointer Input 137(fvec2)
144(i_f2): 143(ptr) Variable Input
147: TypeVector 127(float) 3
148: TypePointer Function 147(fvec3)
150: TypePointer UniformConstant 147(fvec3)
151(u_f3): 150(ptr) Variable UniformConstant
153: TypePointer Input 147(fvec3)
154(i_f3): 153(ptr) Variable Input
157: TypeVector 127(float) 4
158: TypePointer Function 157(fvec4)
160: TypePointer UniformConstant 157(fvec4)
161(u_f4): 160(ptr) Variable UniformConstant
163: TypePointer Input 157(fvec4)
164(i_f4): 163(ptr) Variable Input
167: TypePointer Output 157(fvec4)
168(gl_FragColor): 167(ptr) Variable Output
201: TypeInt 32 0
202: 201(int) Constant 0
206: 201(int) Constant 1
216: 201(int) Constant 2
229: 201(int) Constant 3
265: 127(float) Constant 1065353216
266: 157(fvec4) ConstantComposite 265 265 265 265
90: TypePointer Input 87(int)
91(u_i): 90(ptr) Variable Input
93(i_i): 90(ptr) Variable Input
96: TypeVector 87(int) 2
97: TypePointer Function 96(ivec2)
99: TypePointer Input 96(ivec2)
100(u_i2): 99(ptr) Variable Input
102(i_i2): 99(ptr) Variable Input
105: TypeVector 87(int) 3
106: TypePointer Function 105(ivec3)
108: TypePointer Input 105(ivec3)
109(u_i3): 108(ptr) Variable Input
111(i_i3): 108(ptr) Variable Input
114: TypeVector 87(int) 4
115: TypePointer Function 114(ivec4)
117: TypePointer Input 114(ivec4)
118(u_i4): 117(ptr) Variable Input
120(i_i4): 117(ptr) Variable Input
123: TypeFloat 32
124: TypePointer Function 123(float)
126: TypePointer Input 123(float)
127(u_f): 126(ptr) Variable Input
129(i_f): 126(ptr) Variable Input
132: TypeVector 123(float) 2
133: TypePointer Function 132(fvec2)
135: TypePointer Input 132(fvec2)
136(u_f2): 135(ptr) Variable Input
138(i_f2): 135(ptr) Variable Input
141: TypeVector 123(float) 3
142: TypePointer Function 141(fvec3)
144: TypePointer Input 141(fvec3)
145(u_f3): 144(ptr) Variable Input
147(i_f3): 144(ptr) Variable Input
150: TypeVector 123(float) 4
151: TypePointer Function 150(fvec4)
153: TypePointer Input 150(fvec4)
154(u_f4): 153(ptr) Variable Input
156(i_f4): 153(ptr) Variable Input
159: TypePointer Output 150(fvec4)
160(gl_FragColor): 159(ptr) Variable Output
193: TypeInt 32 0
194: 193(int) Constant 0
198: 193(int) Constant 1
208: 193(int) Constant 2
221: 193(int) Constant 3
257: 123(float) Constant 1065353216
258: 150(fvec4) ConstantComposite 257 257 257 257
4(main): 2 Function None 3
5: Label
8(b): 7(ptr) Variable Function
@@ -141,14 +137,14 @@ Linked fragment stage:
35(b3): 34(ptr) Variable Function
59(b4): 58(ptr) Variable Function
89(i): 88(ptr) Variable Function
99(i2): 98(ptr) Variable Function
109(i3): 108(ptr) Variable Function
119(i4): 118(ptr) Variable Function
129(f): 128(ptr) Variable Function
139(f2): 138(ptr) Variable Function
149(f3): 148(ptr) Variable Function
159(f4): 158(ptr) Variable Function
169: 158(ptr) Variable Function
98(i2): 97(ptr) Variable Function
107(i3): 106(ptr) Variable Function
116(i4): 115(ptr) Variable Function
125(f): 124(ptr) Variable Function
134(f2): 133(ptr) Variable Function
143(f3): 142(ptr) Variable Function
152(f4): 151(ptr) Variable Function
161: 151(ptr) Variable Function
11: 6(bool) Load 10(u_b)
13: 6(bool) Load 12(i_b)
14: 6(bool) LogicalAnd 11 13
@@ -211,134 +207,134 @@ Linked fragment stage:
86: 57(bvec4) CompositeConstruct 85 85 85 85
Store 59(b4) 86
92: 87(int) Load 91(u_i)
95: 87(int) Load 94(i_i)
96: 87(int) IAdd 92 95
Store 89(i) 96
102: 97(ivec2) Load 101(u_i2)
105: 97(ivec2) Load 104(i_i2)
106: 97(ivec2) IAdd 102 105
Store 99(i2) 106
112: 107(ivec3) Load 111(u_i3)
115: 107(ivec3) Load 114(i_i3)
116: 107(ivec3) IAdd 112 115
Store 109(i3) 116
122: 117(ivec4) Load 121(u_i4)
125: 117(ivec4) Load 124(i_i4)
126: 117(ivec4) IAdd 122 125
Store 119(i4) 126
132: 127(float) Load 131(u_f)
135: 127(float) Load 134(i_f)
136: 127(float) FAdd 132 135
Store 129(f) 136
142: 137(fvec2) Load 141(u_f2)
145: 137(fvec2) Load 144(i_f2)
146: 137(fvec2) FAdd 142 145
Store 139(f2) 146
152: 147(fvec3) Load 151(u_f3)
155: 147(fvec3) Load 154(i_f3)
156: 147(fvec3) FAdd 152 155
Store 149(f3) 156
162: 157(fvec4) Load 161(u_f4)
165: 157(fvec4) Load 164(i_f4)
166: 157(fvec4) FAdd 162 165
Store 159(f4) 166
170: 6(bool) Load 8(b)
171: 15(bvec2) Load 17(b2)
172: 6(bool) CompositeExtract 171 0
173: 6(bool) LogicalOr 170 172
174: 15(bvec2) Load 17(b2)
175: 6(bool) CompositeExtract 174 1
176: 6(bool) LogicalOr 173 175
177: 33(bvec3) Load 35(b3)
178: 6(bool) CompositeExtract 177 0
179: 6(bool) LogicalOr 176 178
180: 33(bvec3) Load 35(b3)
181: 6(bool) CompositeExtract 180 1
182: 6(bool) LogicalOr 179 181
183: 33(bvec3) Load 35(b3)
184: 6(bool) CompositeExtract 183 2
185: 6(bool) LogicalOr 182 184
186: 57(bvec4) Load 59(b4)
187: 6(bool) CompositeExtract 186 0
188: 6(bool) LogicalOr 185 187
189: 57(bvec4) Load 59(b4)
190: 6(bool) CompositeExtract 189 1
191: 6(bool) LogicalOr 188 190
192: 57(bvec4) Load 59(b4)
193: 6(bool) CompositeExtract 192 2
194: 6(bool) LogicalOr 191 193
195: 57(bvec4) Load 59(b4)
196: 6(bool) CompositeExtract 195 3
197: 6(bool) LogicalOr 194 196
SelectionMerge 199 None
BranchConditional 197 198 264
198: Label
200: 87(int) Load 89(i)
203: 88(ptr) AccessChain 99(i2) 202
204: 87(int) Load 203
205: 87(int) IAdd 200 204
207: 88(ptr) AccessChain 99(i2) 206
208: 87(int) Load 207
209: 87(int) IAdd 205 208
210: 88(ptr) AccessChain 109(i3) 202
211: 87(int) Load 210
212: 87(int) IAdd 209 211
213: 88(ptr) AccessChain 109(i3) 206
214: 87(int) Load 213
215: 87(int) IAdd 212 214
217: 88(ptr) AccessChain 109(i3) 216
218: 87(int) Load 217
219: 87(int) IAdd 215 218
220: 88(ptr) AccessChain 119(i4) 202
221: 87(int) Load 220
222: 87(int) IAdd 219 221
223: 88(ptr) AccessChain 119(i4) 206
224: 87(int) Load 223
225: 87(int) IAdd 222 224
226: 88(ptr) AccessChain 119(i4) 216
227: 87(int) Load 226
228: 87(int) IAdd 225 227
230: 88(ptr) AccessChain 119(i4) 229
231: 87(int) Load 230
232: 87(int) IAdd 228 231
233: 127(float) ConvertSToF 232
234: 127(float) Load 129(f)
235: 127(float) FAdd 233 234
236: 128(ptr) AccessChain 139(f2) 202
237: 127(float) Load 236
238: 127(float) FAdd 235 237
239: 128(ptr) AccessChain 139(f2) 206
240: 127(float) Load 239
241: 127(float) FAdd 238 240
242: 128(ptr) AccessChain 149(f3) 202
243: 127(float) Load 242
244: 127(float) FAdd 241 243
245: 128(ptr) AccessChain 149(f3) 206
246: 127(float) Load 245
247: 127(float) FAdd 244 246
248: 128(ptr) AccessChain 149(f3) 216
249: 127(float) Load 248
250: 127(float) FAdd 247 249
251: 128(ptr) AccessChain 159(f4) 202
252: 127(float) Load 251
253: 127(float) FAdd 250 252
254: 128(ptr) AccessChain 159(f4) 206
255: 127(float) Load 254
256: 127(float) FAdd 253 255
257: 128(ptr) AccessChain 159(f4) 216
258: 127(float) Load 257
259: 127(float) FAdd 256 258
260: 128(ptr) AccessChain 159(f4) 229
261: 127(float) Load 260
262: 127(float) FAdd 259 261
263: 157(fvec4) CompositeConstruct 262 262 262 262
Store 169 263
Branch 199
264: Label
Store 169 266
Branch 199
199: Label
267: 157(fvec4) Load 169
Store 168(gl_FragColor) 267
94: 87(int) Load 93(i_i)
95: 87(int) IAdd 92 94
Store 89(i) 95
101: 96(ivec2) Load 100(u_i2)
103: 96(ivec2) Load 102(i_i2)
104: 96(ivec2) IAdd 101 103
Store 98(i2) 104
110: 105(ivec3) Load 109(u_i3)
112: 105(ivec3) Load 111(i_i3)
113: 105(ivec3) IAdd 110 112
Store 107(i3) 113
119: 114(ivec4) Load 118(u_i4)
121: 114(ivec4) Load 120(i_i4)
122: 114(ivec4) IAdd 119 121
Store 116(i4) 122
128: 123(float) Load 127(u_f)
130: 123(float) Load 129(i_f)
131: 123(float) FAdd 128 130
Store 125(f) 131
137: 132(fvec2) Load 136(u_f2)
139: 132(fvec2) Load 138(i_f2)
140: 132(fvec2) FAdd 137 139
Store 134(f2) 140
146: 141(fvec3) Load 145(u_f3)
148: 141(fvec3) Load 147(i_f3)
149: 141(fvec3) FAdd 146 148
Store 143(f3) 149
155: 150(fvec4) Load 154(u_f4)
157: 150(fvec4) Load 156(i_f4)
158: 150(fvec4) FAdd 155 157
Store 152(f4) 158
162: 6(bool) Load 8(b)
163: 15(bvec2) Load 17(b2)
164: 6(bool) CompositeExtract 163 0
165: 6(bool) LogicalOr 162 164
166: 15(bvec2) Load 17(b2)
167: 6(bool) CompositeExtract 166 1
168: 6(bool) LogicalOr 165 167
169: 33(bvec3) Load 35(b3)
170: 6(bool) CompositeExtract 169 0
171: 6(bool) LogicalOr 168 170
172: 33(bvec3) Load 35(b3)
173: 6(bool) CompositeExtract 172 1
174: 6(bool) LogicalOr 171 173
175: 33(bvec3) Load 35(b3)
176: 6(bool) CompositeExtract 175 2
177: 6(bool) LogicalOr 174 176
178: 57(bvec4) Load 59(b4)
179: 6(bool) CompositeExtract 178 0
180: 6(bool) LogicalOr 177 179
181: 57(bvec4) Load 59(b4)
182: 6(bool) CompositeExtract 181 1
183: 6(bool) LogicalOr 180 182
184: 57(bvec4) Load 59(b4)
185: 6(bool) CompositeExtract 184 2
186: 6(bool) LogicalOr 183 185
187: 57(bvec4) Load 59(b4)
188: 6(bool) CompositeExtract 187 3
189: 6(bool) LogicalOr 186 188
SelectionMerge 191 None
BranchConditional 189 190 256
190: Label
192: 87(int) Load 89(i)
195: 88(ptr) AccessChain 98(i2) 194
196: 87(int) Load 195
197: 87(int) IAdd 192 196
199: 88(ptr) AccessChain 98(i2) 198
200: 87(int) Load 199
201: 87(int) IAdd 197 200
202: 88(ptr) AccessChain 107(i3) 194
203: 87(int) Load 202
204: 87(int) IAdd 201 203
205: 88(ptr) AccessChain 107(i3) 198
206: 87(int) Load 205
207: 87(int) IAdd 204 206
209: 88(ptr) AccessChain 107(i3) 208
210: 87(int) Load 209
211: 87(int) IAdd 207 210
212: 88(ptr) AccessChain 116(i4) 194
213: 87(int) Load 212
214: 87(int) IAdd 211 213
215: 88(ptr) AccessChain 116(i4) 198
216: 87(int) Load 215
217: 87(int) IAdd 214 216
218: 88(ptr) AccessChain 116(i4) 208
219: 87(int) Load 218
220: 87(int) IAdd 217 219
222: 88(ptr) AccessChain 116(i4) 221
223: 87(int) Load 222
224: 87(int) IAdd 220 223
225: 123(float) ConvertSToF 224
226: 123(float) Load 125(f)
227: 123(float) FAdd 225 226
228: 124(ptr) AccessChain 134(f2) 194
229: 123(float) Load 228
230: 123(float) FAdd 227 229
231: 124(ptr) AccessChain 134(f2) 198
232: 123(float) Load 231
233: 123(float) FAdd 230 232
234: 124(ptr) AccessChain 143(f3) 194
235: 123(float) Load 234
236: 123(float) FAdd 233 235
237: 124(ptr) AccessChain 143(f3) 198
238: 123(float) Load 237
239: 123(float) FAdd 236 238
240: 124(ptr) AccessChain 143(f3) 208
241: 123(float) Load 240
242: 123(float) FAdd 239 241
243: 124(ptr) AccessChain 152(f4) 194
244: 123(float) Load 243
245: 123(float) FAdd 242 244
246: 124(ptr) AccessChain 152(f4) 198
247: 123(float) Load 246
248: 123(float) FAdd 245 247
249: 124(ptr) AccessChain 152(f4) 208
250: 123(float) Load 249
251: 123(float) FAdd 248 250
252: 124(ptr) AccessChain 152(f4) 221
253: 123(float) Load 252
254: 123(float) FAdd 251 253
255: 150(fvec4) CompositeConstruct 254 254 254 254
Store 161 255
Branch 191
256: Label
Store 161 258
Branch 191
191: Label
259: 150(fvec4) Load 161
Store 160(gl_FragColor) 259
Return
FunctionEnd