1spv.debugInfo.frag
2// Module Version 10000
3// Generated by (magic number): 8000b
4// Id's are bound by 187
5
6                              Capability Shader
7               2:             ExtInstImport  "GLSL.std.450"
8                              MemoryModel Logical GLSL450
9                              EntryPoint Fragment 5  "main" 30 104
10                              ExecutionMode 5 OriginLowerLeft
11               1:             String  "spv.debugInfo.frag"
12                              Source GLSL 450 1  "// OpModuleProcessed no-storage-format
13// OpModuleProcessed resource-set-binding 3
14// OpModuleProcessed auto-map-bindings
15// OpModuleProcessed auto-map-locations
16// OpModuleProcessed client opengl100
17// OpModuleProcessed target-env opengl
18// OpModuleProcessed relaxed-errors
19// OpModuleProcessed suppress-warnings
20// OpModuleProcessed hlsl-offsets
21// OpModuleProcessed entry-point main
22#line 1
23#version 450
24
25struct S {
26    int a;
27};
28
29uniform ubuf {
30    S s;
31};
32
33uniform sampler2D s2d;
34
35layout(location = 0) in vec4 inv;
36layout(location = 0) out vec4 outv;
37
38vec4 foo(S s)
39{
40    vec4 r = s.a * inv;
41    ++r;
42    if (r.x > 3.0)
43        --r;
44    else
45        r *= 2;
46
47    return r;
48}
49
50float testBranch(float x, float y)
51{
52    float result = 0;
53    bool b = x > 0;
54
55    // branch with load
56    if (b) {
57        result += 1;
58    }
59    else {
60        result -= 1;
61    }
62
63    // branch with expression
64    if (x > y) {
65        result += x - y;
66    }
67
68    // selection with load
69    result += b ?
70        1 : -1;
71
72    // selection with expression
73    result += x < y ?
74        y :
75        float(b);
76
77    return result;
78}
79
80void main()
81{
82    outv = foo(s);
83    outv += testBranch(inv.x, inv.y);
84    outv += texture(s2d, vec2(0.5));
85
86    switch (s.a) {
87    case 10:
88        ++outv;
89        break;
90    case 20:
91        outv = 2 * outv;
92        ++outv;
93        break;
94    default:
95        --outv;
96        break;
97    }
98
99    for (int i = 0; i < 10; ++i)
100        outv *= 3.0;
101
102    outv.x < 10.0 ?
103        outv = sin(outv) :
104        outv = cos(outv);
105}"
106                              Name 5  "main"
107                              Name 8  "S"
108                              MemberName 8(S) 0  "a"
109                              Name 14  "foo(struct-S-i11;"
110                              Name 13  "s"
111                              Name 20  "testBranch(f1;f1;"
112                              Name 18  "x"
113                              Name 19  "y"
114                              Name 23  "r"
115                              Name 30  "inv"
116                              Name 56  "result"
117                              Name 59  "b"
118                              Name 104  "outv"
119                              Name 105  "S"
120                              MemberName 105(S) 0  "a"
121                              Name 106  "ubuf"
122                              MemberName 106(ubuf) 0  "s"
123                              Name 108  ""
124                              Name 109  "param"
125                              Name 116  "param"
126                              Name 120  "param"
127                              Name 131  "s2d"
128                              Name 161  "i"
129                              Decorate 30(inv) Location 0
130                              Decorate 104(outv) Location 0
131                              MemberDecorate 105(S) 0 Offset 0
132                              MemberDecorate 106(ubuf) 0 Offset 0
133                              Decorate 106(ubuf) Block
134                              Decorate 108 DescriptorSet 3
135                              Decorate 108 Binding 0
136                              Decorate 131(s2d) Location 0
137                              Decorate 131(s2d) DescriptorSet 3
138                              Decorate 131(s2d) Binding 1
139               3:             TypeVoid
140               4:             TypeFunction 3
141               7:             TypeInt 32 1
142            8(S):             TypeStruct 7(int)
143               9:             TypePointer Function 8(S)
144              10:             TypeFloat 32
145              11:             TypeVector 10(float) 4
146              12:             TypeFunction 11(fvec4) 9(ptr)
147              16:             TypePointer Function 10(float)
148              17:             TypeFunction 10(float) 16(ptr) 16(ptr)
149              22:             TypePointer Function 11(fvec4)
150              24:      7(int) Constant 0
151              25:             TypePointer Function 7(int)
152              29:             TypePointer Input 11(fvec4)
153         30(inv):     29(ptr) Variable Input
154              34:   10(float) Constant 1065353216
155              37:             TypeInt 32 0
156              38:     37(int) Constant 0
157              41:   10(float) Constant 1077936128
158              42:             TypeBool
159              50:   10(float) Constant 1073741824
160              57:   10(float) Constant 0
161              58:             TypePointer Function 42(bool)
162              81:      7(int) Constant 1
163              82:      7(int) Constant 4294967295
164             103:             TypePointer Output 11(fvec4)
165       104(outv):    103(ptr) Variable Output
166          105(S):             TypeStruct 7(int)
167       106(ubuf):             TypeStruct 105(S)
168             107:             TypePointer Uniform 106(ubuf)
169             108:    107(ptr) Variable Uniform
170             110:             TypePointer Uniform 105(S)
171             117:             TypePointer Input 10(float)
172             121:     37(int) Constant 1
173             128:             TypeImage 10(float) 2D sampled format:Unknown
174             129:             TypeSampledImage 128
175             130:             TypePointer UniformConstant 129
176        131(s2d):    130(ptr) Variable UniformConstant
177             133:             TypeVector 10(float) 2
178             134:   10(float) Constant 1056964608
179             135:  133(fvec2) ConstantComposite 134 134
180             139:             TypePointer Uniform 7(int)
181             168:      7(int) Constant 10
182             174:             TypePointer Output 10(float)
183             177:   10(float) Constant 1092616192
184                              Line 1 58 11
185         5(main):           3 Function None 4
186               6:             Label
187      109(param):      9(ptr) Variable Function
188      116(param):     16(ptr) Variable Function
189      120(param):     16(ptr) Variable Function
190          161(i):     25(ptr) Variable Function
191             179:     22(ptr) Variable Function
192                              Line 1 60 0
193             111:    110(ptr) AccessChain 108 24
194             112:      105(S) Load 111
195             113:      7(int) CompositeExtract 112 0
196             114:     25(ptr) AccessChain 109(param) 24
197                              Store 114 113
198             115:   11(fvec4) FunctionCall 14(foo(struct-S-i11;) 109(param)
199                              Store 104(outv) 115
200                              Line 1 61 0
201             118:    117(ptr) AccessChain 30(inv) 38
202             119:   10(float) Load 118
203                              Store 116(param) 119
204             122:    117(ptr) AccessChain 30(inv) 121
205             123:   10(float) Load 122
206                              Store 120(param) 123
207             124:   10(float) FunctionCall 20(testBranch(f1;f1;) 116(param) 120(param)
208             125:   11(fvec4) Load 104(outv)
209             126:   11(fvec4) CompositeConstruct 124 124 124 124
210             127:   11(fvec4) FAdd 125 126
211                              Store 104(outv) 127
212                              Line 1 62 0
213             132:         129 Load 131(s2d)
214             136:   11(fvec4) ImageSampleImplicitLod 132 135
215             137:   11(fvec4) Load 104(outv)
216             138:   11(fvec4) FAdd 137 136
217                              Store 104(outv) 138
218                              Line 1 64 0
219             140:    139(ptr) AccessChain 108 24 24
220             141:      7(int) Load 140
221                              SelectionMerge 145 None
222                              Switch 141 144
223                                     case 10: 142
224                                     case 20: 143
225             144:               Label
226                                Line 1 73 0
227             156:   11(fvec4)   Load 104(outv)
228             157:   11(fvec4)   CompositeConstruct 34 34 34 34
229             158:   11(fvec4)   FSub 156 157
230                                Store 104(outv) 158
231                                Line 1 74 0
232                                Branch 145
233             142:               Label
234                                Line 1 66 0
235             146:   11(fvec4)   Load 104(outv)
236             147:   11(fvec4)   CompositeConstruct 34 34 34 34
237             148:   11(fvec4)   FAdd 146 147
238                                Store 104(outv) 148
239                                Line 1 67 0
240                                Branch 145
241             143:               Label
242                                Line 1 69 0
243             150:   11(fvec4)   Load 104(outv)
244             151:   11(fvec4)   VectorTimesScalar 150 50
245                                Store 104(outv) 151
246                                Line 1 70 0
247             152:   11(fvec4)   Load 104(outv)
248             153:   11(fvec4)   CompositeConstruct 34 34 34 34
249             154:   11(fvec4)   FAdd 152 153
250                                Store 104(outv) 154
251                                Line 1 71 0
252                                Branch 145
253             145:             Label
254                              Line 1 77 0
255                              Store 161(i) 24
256                              Branch 162
257             162:             Label
258                              Line 1 77 0
259                              LoopMerge 164 165 None
260                              Branch 166
261             166:             Label
262                              Line 1 77 0
263             167:      7(int) Load 161(i)
264             169:    42(bool) SLessThan 167 168
265                              BranchConditional 169 163 164
266             163:               Label
267                                Line 1 78 0
268             170:   11(fvec4)   Load 104(outv)
269             171:   11(fvec4)   VectorTimesScalar 170 41
270                                Store 104(outv) 171
271                                Branch 165
272             165:               Label
273                                Line 1 77 0
274             172:      7(int)   Load 161(i)
275             173:      7(int)   IAdd 172 81
276                                Store 161(i) 173
277                                Branch 162
278             164:             Label
279                              Line 1 80 0
280             175:    174(ptr) AccessChain 104(outv) 38
281             176:   10(float) Load 175
282             178:    42(bool) FOrdLessThan 176 177
283                              SelectionMerge 181 None
284                              BranchConditional 178 180 184
285             180:               Label
286                                Line 1 81 0
287             182:   11(fvec4)   Load 104(outv)
288             183:   11(fvec4)   ExtInst 2(GLSL.std.450) 13(Sin) 182
289                                Store 104(outv) 183
290                                Store 179 183
291                                Branch 181
292             184:               Label
293                                Line 1 82 0
294             185:   11(fvec4)   Load 104(outv)
295             186:   11(fvec4)   ExtInst 2(GLSL.std.450) 14(Cos) 185
296                                Store 104(outv) 186
297                                Store 179 186
298                                Branch 181
299             181:             Label
300                              Return
301                              FunctionEnd
302                              Line 1 16 13
30314(foo(struct-S-i11;):   11(fvec4) Function None 12
304           13(s):      9(ptr) FunctionParameter
305              15:             Label
306           23(r):     22(ptr) Variable Function
307                              Line 1 18 0
308              26:     25(ptr) AccessChain 13(s) 24
309              27:      7(int) Load 26
310              28:   10(float) ConvertSToF 27
311              31:   11(fvec4) Load 30(inv)
312              32:   11(fvec4) VectorTimesScalar 31 28
313                              Store 23(r) 32
314                              Line 1 19 0
315              33:   11(fvec4) Load 23(r)
316              35:   11(fvec4) CompositeConstruct 34 34 34 34
317              36:   11(fvec4) FAdd 33 35
318                              Store 23(r) 36
319                              Line 1 20 0
320              39:     16(ptr) AccessChain 23(r) 38
321              40:   10(float) Load 39
322              43:    42(bool) FOrdGreaterThan 40 41
323                              SelectionMerge 45 None
324                              BranchConditional 43 44 49
325              44:               Label
326                                Line 1 21 0
327              46:   11(fvec4)   Load 23(r)
328              47:   11(fvec4)   CompositeConstruct 34 34 34 34
329              48:   11(fvec4)   FSub 46 47
330                                Store 23(r) 48
331                                Branch 45
332              49:               Label
333                                Line 1 23 0
334              51:   11(fvec4)   Load 23(r)
335              52:   11(fvec4)   VectorTimesScalar 51 50
336                                Store 23(r) 52
337                                Branch 45
338              45:             Label
339                              Line 1 25 0
340              53:   11(fvec4) Load 23(r)
341                              ReturnValue 53
342                              FunctionEnd
343                              Line 1 28 34
34420(testBranch(f1;f1;):   10(float) Function None 17
345           18(x):     16(ptr) FunctionParameter
346           19(y):     16(ptr) FunctionParameter
347              21:             Label
348      56(result):     16(ptr) Variable Function
349           59(b):     58(ptr) Variable Function
350              90:     16(ptr) Variable Function
351                              Line 1 30 0
352                              Store 56(result) 57
353                              Line 1 31 0
354              60:   10(float) Load 18(x)
355              61:    42(bool) FOrdGreaterThan 60 57
356                              Store 59(b) 61
357                              Line 1 34 0
358              62:    42(bool) Load 59(b)
359                              SelectionMerge 64 None
360                              BranchConditional 62 63 67
361              63:               Label
362                                Line 1 35 0
363              65:   10(float)   Load 56(result)
364              66:   10(float)   FAdd 65 34
365                                Store 56(result) 66
366                                Branch 64
367              67:               Label
368                                Line 1 38 0
369              68:   10(float)   Load 56(result)
370              69:   10(float)   FSub 68 34
371                                Store 56(result) 69
372                                Branch 64
373              64:             Label
374                              Line 1 42 0
375              70:   10(float) Load 18(x)
376              71:   10(float) Load 19(y)
377              72:    42(bool) FOrdGreaterThan 70 71
378                              SelectionMerge 74 None
379                              BranchConditional 72 73 74
380              73:               Label
381                                Line 1 43 0
382              75:   10(float)   Load 18(x)
383              76:   10(float)   Load 19(y)
384              77:   10(float)   FSub 75 76
385              78:   10(float)   Load 56(result)
386              79:   10(float)   FAdd 78 77
387                                Store 56(result) 79
388                                Branch 74
389              74:             Label
390                              Line 1 47 0
391              80:    42(bool) Load 59(b)
392              83:      7(int) Select 80 81 82
393              84:   10(float) ConvertSToF 83
394              85:   10(float) Load 56(result)
395              86:   10(float) FAdd 85 84
396                              Store 56(result) 86
397                              Line 1 51 0
398              87:   10(float) Load 18(x)
399              88:   10(float) Load 19(y)
400              89:    42(bool) FOrdLessThan 87 88
401                              SelectionMerge 92 None
402                              BranchConditional 89 91 94
403              91:               Label
404                                Line 1 52 0
405              93:   10(float)   Load 19(y)
406                                Store 90 93
407                                Branch 92
408              94:               Label
409                                Line 1 53 0
410              95:    42(bool)   Load 59(b)
411              96:   10(float)   Select 95 34 57
412                                Store 90 96
413                                Branch 92
414              92:             Label
415              97:   10(float) Load 90
416                              Line 1 51 0
417              98:   10(float) Load 56(result)
418              99:   10(float) FAdd 98 97
419                              Store 56(result) 99
420                              Line 1 55 0
421             100:   10(float) Load 56(result)
422                              ReturnValue 100
423                              FunctionEnd
424