xref: /aosp_15_r20/external/angle/third_party/glslang/src/Test/baseResults/spv.debugInfo.frag.out (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
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                              Decorate 106(ubuf) Block
133                              MemberDecorate 106(ubuf) 0 Offset 0
134                              Decorate 108 Binding 0
135                              Decorate 108 DescriptorSet 3
136                              Decorate 131(s2d) Location 0
137                              Decorate 131(s2d) Binding 1
138                              Decorate 131(s2d) DescriptorSet 3
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                              Line 1 83 0
301                              Return
302                              FunctionEnd
303                              Line 1 16 13
30414(foo(struct-S-i11;):   11(fvec4) Function None 12
305           13(s):      9(ptr) FunctionParameter
306              15:             Label
307           23(r):     22(ptr) Variable Function
308                              Line 1 18 0
309              26:     25(ptr) AccessChain 13(s) 24
310              27:      7(int) Load 26
311              28:   10(float) ConvertSToF 27
312              31:   11(fvec4) Load 30(inv)
313              32:   11(fvec4) VectorTimesScalar 31 28
314                              Store 23(r) 32
315                              Line 1 19 0
316              33:   11(fvec4) Load 23(r)
317              35:   11(fvec4) CompositeConstruct 34 34 34 34
318              36:   11(fvec4) FAdd 33 35
319                              Store 23(r) 36
320                              Line 1 20 0
321              39:     16(ptr) AccessChain 23(r) 38
322              40:   10(float) Load 39
323              43:    42(bool) FOrdGreaterThan 40 41
324                              SelectionMerge 45 None
325                              BranchConditional 43 44 49
326              44:               Label
327                                Line 1 21 0
328              46:   11(fvec4)   Load 23(r)
329              47:   11(fvec4)   CompositeConstruct 34 34 34 34
330              48:   11(fvec4)   FSub 46 47
331                                Store 23(r) 48
332                                Branch 45
333              49:               Label
334                                Line 1 23 0
335              51:   11(fvec4)   Load 23(r)
336              52:   11(fvec4)   VectorTimesScalar 51 50
337                                Store 23(r) 52
338                                Branch 45
339              45:             Label
340                              Line 1 25 0
341              53:   11(fvec4) Load 23(r)
342                              ReturnValue 53
343                              FunctionEnd
344                              Line 1 28 34
34520(testBranch(f1;f1;):   10(float) Function None 17
346           18(x):     16(ptr) FunctionParameter
347           19(y):     16(ptr) FunctionParameter
348              21:             Label
349      56(result):     16(ptr) Variable Function
350           59(b):     58(ptr) Variable Function
351              90:     16(ptr) Variable Function
352                              Line 1 30 0
353                              Store 56(result) 57
354                              Line 1 31 0
355              60:   10(float) Load 18(x)
356              61:    42(bool) FOrdGreaterThan 60 57
357                              Store 59(b) 61
358                              Line 1 34 0
359              62:    42(bool) Load 59(b)
360                              SelectionMerge 64 None
361                              BranchConditional 62 63 67
362              63:               Label
363                                Line 1 35 0
364              65:   10(float)   Load 56(result)
365              66:   10(float)   FAdd 65 34
366                                Store 56(result) 66
367                                Branch 64
368              67:               Label
369                                Line 1 38 0
370              68:   10(float)   Load 56(result)
371              69:   10(float)   FSub 68 34
372                                Store 56(result) 69
373                                Branch 64
374              64:             Label
375                              Line 1 42 0
376              70:   10(float) Load 18(x)
377              71:   10(float) Load 19(y)
378              72:    42(bool) FOrdGreaterThan 70 71
379                              SelectionMerge 74 None
380                              BranchConditional 72 73 74
381              73:               Label
382                                Line 1 43 0
383              75:   10(float)   Load 18(x)
384              76:   10(float)   Load 19(y)
385              77:   10(float)   FSub 75 76
386              78:   10(float)   Load 56(result)
387              79:   10(float)   FAdd 78 77
388                                Store 56(result) 79
389                                Branch 74
390              74:             Label
391                              Line 1 47 0
392              80:    42(bool) Load 59(b)
393              83:      7(int) Select 80 81 82
394              84:   10(float) ConvertSToF 83
395              85:   10(float) Load 56(result)
396              86:   10(float) FAdd 85 84
397                              Store 56(result) 86
398                              Line 1 51 0
399              87:   10(float) Load 18(x)
400              88:   10(float) Load 19(y)
401              89:    42(bool) FOrdLessThan 87 88
402                              SelectionMerge 92 None
403                              BranchConditional 89 91 94
404              91:               Label
405                                Line 1 52 0
406              93:   10(float)   Load 19(y)
407                                Store 90 93
408                                Branch 92
409              94:               Label
410                                Line 1 53 0
411              95:    42(bool)   Load 59(b)
412              96:   10(float)   Select 95 34 57
413                                Store 90 96
414                                Branch 92
415              92:             Label
416                              Line 1 53 0
417              97:   10(float) Load 90
418                              Line 1 51 0
419              98:   10(float) Load 56(result)
420              99:   10(float) FAdd 98 97
421                              Store 56(result) 99
422                              Line 1 55 0
423             100:   10(float) Load 56(result)
424                              ReturnValue 100
425                              FunctionEnd
426