xref: /aosp_15_r20/external/angle/third_party/glslang/src/Test/baseResults/hlsl.structbuffer.frag.out (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1hlsl.structbuffer.frag
2Shader version: 500
3gl_FragCoord origin is upper left
40:? Sequence
50:12  Function Definition: @main(u1; ( temp 4-component vector of float)
60:12    Function Parameters:
70:12      'pos' ( in uint)
80:?     Sequence
90:13      Sequence
100:13        move second child to first child ( temp structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
110:13          'mydata' ( temp structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
120:13          indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
130:13            @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
140:13              'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
150:13              Constant:
160:13                0 (const uint)
170:13            'pos' ( in uint)
180:17      Sequence
190:17        move second child to first child ( temp uint)
200:17          'size' ( temp uint)
210:17          array length ( temp uint)
220:17            @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
230:17              'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
240:17              Constant:
250:17                0 (const uint)
260:17        move second child to first child ( temp uint)
270:17          'stride' ( temp uint)
280:17          Constant:
290:17            32 (const uint)
300:19      Test condition and select ( temp void)
310:19        Condition
320:19        test: direct index for structure ( temp bool)
330:19          indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
340:19            @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
350:19              'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
360:19              Constant:
370:19                0 (const uint)
380:19            'pos' ( in uint)
390:19          Constant:
400:19            1 (const int)
410:19        true case
420:20        Branch: Return with expression
430:20          Construct vec4 ( temp 4-component vector of float)
440:20            add ( temp 3-component vector of float)
450:20              color: direct index for structure ( temp 3-component vector of float)
460:20                indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
470:20                  @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
480:20                    'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
490:20                    Constant:
500:20                      0 (const uint)
510:20                  'pos' ( in uint)
520:20                Constant:
530:20                  0 (const int)
540:20              indirect index (layout( row_major std430) buffer float)
550:20                @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float)
560:20                  'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data})
570:20                  Constant:
580:20                    0 (const uint)
590:20                'pos' ( in uint)
600:20            Constant:
610:20              0.000000
620:19        false case
630:22        Branch: Return with expression
640:22          Construct vec4 ( temp 4-component vector of float)
650:22            add ( temp float)
660:22              add ( temp float)
670:22                direct index ( temp float)
680:22                  color: direct index for structure ( temp 3-component vector of float)
690:22                    'mydata' ( temp structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
700:22                    Constant:
710:22                      0 (const int)
720:22                  Constant:
730:22                    0 (const int)
740:22                Convert uint to float ( temp float)
750:22                  'size' ( temp uint)
760:22              Convert uint to float ( temp float)
770:22                'stride' ( temp uint)
780:12  Function Definition: main( ( temp void)
790:12    Function Parameters:
800:?     Sequence
810:12      move second child to first child ( temp uint)
820:?         'pos' ( temp uint)
830:?         'pos' (layout( location=0) flat in uint)
840:12      move second child to first child ( temp 4-component vector of float)
850:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
860:12        Function Call: @main(u1; ( temp 4-component vector of float)
870:?           'pos' ( temp uint)
880:?   Linker Objects
890:?     'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
900:?     'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data})
910:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
920:?     'pos' (layout( location=0) flat in uint)
93
94
95Linked fragment stage:
96
97
98Shader version: 500
99gl_FragCoord origin is upper left
1000:? Sequence
1010:12  Function Definition: @main(u1; ( temp 4-component vector of float)
1020:12    Function Parameters:
1030:12      'pos' ( in uint)
1040:?     Sequence
1050:13      Sequence
1060:13        move second child to first child ( temp structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1070:13          'mydata' ( temp structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1080:13          indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1090:13            @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1100:13              'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
1110:13              Constant:
1120:13                0 (const uint)
1130:13            'pos' ( in uint)
1140:17      Sequence
1150:17        move second child to first child ( temp uint)
1160:17          'size' ( temp uint)
1170:17          array length ( temp uint)
1180:17            @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1190:17              'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
1200:17              Constant:
1210:17                0 (const uint)
1220:17        move second child to first child ( temp uint)
1230:17          'stride' ( temp uint)
1240:17          Constant:
1250:17            32 (const uint)
1260:19      Test condition and select ( temp void)
1270:19        Condition
1280:19        test: direct index for structure ( temp bool)
1290:19          indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1300:19            @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1310:19              'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
1320:19              Constant:
1330:19                0 (const uint)
1340:19            'pos' ( in uint)
1350:19          Constant:
1360:19            1 (const int)
1370:19        true case
1380:20        Branch: Return with expression
1390:20          Construct vec4 ( temp 4-component vector of float)
1400:20            add ( temp 3-component vector of float)
1410:20              color: direct index for structure ( temp 3-component vector of float)
1420:20                indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1430:20                  @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1440:20                    'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
1450:20                    Constant:
1460:20                      0 (const uint)
1470:20                  'pos' ( in uint)
1480:20                Constant:
1490:20                  0 (const int)
1500:20              indirect index (layout( row_major std430) buffer float)
1510:20                @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float)
1520:20                  'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data})
1530:20                  Constant:
1540:20                    0 (const uint)
1550:20                'pos' ( in uint)
1560:20            Constant:
1570:20              0.000000
1580:19        false case
1590:22        Branch: Return with expression
1600:22          Construct vec4 ( temp 4-component vector of float)
1610:22            add ( temp float)
1620:22              add ( temp float)
1630:22                direct index ( temp float)
1640:22                  color: direct index for structure ( temp 3-component vector of float)
1650:22                    'mydata' ( temp structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2})
1660:22                    Constant:
1670:22                      0 (const int)
1680:22                  Constant:
1690:22                    0 (const int)
1700:22                Convert uint to float ( temp float)
1710:22                  'size' ( temp uint)
1720:22              Convert uint to float ( temp float)
1730:22                'stride' ( temp uint)
1740:12  Function Definition: main( ( temp void)
1750:12    Function Parameters:
1760:?     Sequence
1770:12      move second child to first child ( temp uint)
1780:?         'pos' ( temp uint)
1790:?         'pos' (layout( location=0) flat in uint)
1800:12      move second child to first child ( temp 4-component vector of float)
1810:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
1820:12        Function Call: @main(u1; ( temp 4-component vector of float)
1830:?           'pos' ( temp uint)
1840:?   Linker Objects
1850:?     'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color,  temp bool test,  temp bool test2} @data})
1860:?     'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data})
1870:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
1880:?     'pos' (layout( location=0) flat in uint)
189
190// Module Version 10000
191// Generated by (magic number): 8000b
192// Id's are bound by 96
193
194                              Capability Shader
195               1:             ExtInstImport  "GLSL.std.450"
196                              MemoryModel Logical GLSL450
197                              EntryPoint Fragment 4  "main" 89 92
198                              ExecutionMode 4 OriginUpperLeft
199                              Source HLSL 500
200                              Name 4  "main"
201                              Name 12  "@main(u1;"
202                              Name 11  "pos"
203                              Name 16  "sb_t"
204                              MemberName 16(sb_t) 0  "color"
205                              MemberName 16(sb_t) 1  "test"
206                              MemberName 16(sb_t) 2  "test2"
207                              Name 18  "mydata"
208                              Name 19  "sb_t"
209                              MemberName 19(sb_t) 0  "color"
210                              MemberName 19(sb_t) 1  "test"
211                              MemberName 19(sb_t) 2  "test2"
212                              Name 21  "sbuf"
213                              MemberName 21(sbuf) 0  "@data"
214                              Name 23  "sbuf"
215                              Name 43  "size"
216                              Name 45  "stride"
217                              Name 59  "sbuf2"
218                              MemberName 59(sbuf2) 0  "@data"
219                              Name 61  "sbuf2"
220                              Name 87  "pos"
221                              Name 89  "pos"
222                              Name 92  "@entryPointOutput"
223                              Name 93  "param"
224                              MemberDecorate 19(sb_t) 0 Offset 0
225                              MemberDecorate 19(sb_t) 1 Offset 12
226                              MemberDecorate 19(sb_t) 2 Offset 16
227                              Decorate 20 ArrayStride 32
228                              Decorate 21(sbuf) BufferBlock
229                              MemberDecorate 21(sbuf) 0 NonWritable
230                              MemberDecorate 21(sbuf) 0 Offset 0
231                              Decorate 23(sbuf) NonWritable
232                              Decorate 23(sbuf) Binding 10
233                              Decorate 23(sbuf) DescriptorSet 0
234                              Decorate 58 ArrayStride 4
235                              Decorate 59(sbuf2) BufferBlock
236                              MemberDecorate 59(sbuf2) 0 NonWritable
237                              MemberDecorate 59(sbuf2) 0 Offset 0
238                              Decorate 61(sbuf2) NonWritable
239                              Decorate 61(sbuf2) Binding 0
240                              Decorate 61(sbuf2) DescriptorSet 0
241                              Decorate 89(pos) Flat
242                              Decorate 89(pos) Location 0
243                              Decorate 92(@entryPointOutput) Location 0
244               2:             TypeVoid
245               3:             TypeFunction 2
246               6:             TypeInt 32 0
247               7:             TypePointer Function 6(int)
248               8:             TypeFloat 32
249               9:             TypeVector 8(float) 4
250              10:             TypeFunction 9(fvec4) 7(ptr)
251              14:             TypeVector 8(float) 3
252              15:             TypeBool
253        16(sb_t):             TypeStruct 14(fvec3) 15(bool) 15(bool)
254              17:             TypePointer Function 16(sb_t)
255        19(sb_t):             TypeStruct 14(fvec3) 6(int) 6(int)
256              20:             TypeRuntimeArray 19(sb_t)
257        21(sbuf):             TypeStruct 20
258              22:             TypePointer Uniform 21(sbuf)
259        23(sbuf):     22(ptr) Variable Uniform
260              24:             TypeInt 32 1
261              25:     24(int) Constant 0
262              27:             TypePointer Uniform 19(sb_t)
263              31:             TypePointer Function 14(fvec3)
264              34:     24(int) Constant 1
265              35:      6(int) Constant 0
266              37:             TypePointer Function 15(bool)
267              40:     24(int) Constant 2
268              46:      6(int) Constant 32
269              48:             TypePointer Uniform 6(int)
270              55:             TypePointer Uniform 14(fvec3)
271              58:             TypeRuntimeArray 8(float)
272       59(sbuf2):             TypeStruct 58
273              60:             TypePointer Uniform 59(sbuf2)
274       61(sbuf2):     60(ptr) Variable Uniform
275              63:             TypePointer Uniform 8(float)
276              68:    8(float) Constant 0
277              75:             TypePointer Function 8(float)
278              88:             TypePointer Input 6(int)
279         89(pos):     88(ptr) Variable Input
280              91:             TypePointer Output 9(fvec4)
28192(@entryPointOutput):     91(ptr) Variable Output
282         4(main):           2 Function None 3
283               5:             Label
284         87(pos):      7(ptr) Variable Function
285       93(param):      7(ptr) Variable Function
286              90:      6(int) Load 89(pos)
287                              Store 87(pos) 90
288              94:      6(int) Load 87(pos)
289                              Store 93(param) 94
290              95:    9(fvec4) FunctionCall 12(@main(u1;) 93(param)
291                              Store 92(@entryPointOutput) 95
292                              Return
293                              FunctionEnd
294   12(@main(u1;):    9(fvec4) Function None 10
295         11(pos):      7(ptr) FunctionParameter
296              13:             Label
297      18(mydata):     17(ptr) Variable Function
298        43(size):      7(ptr) Variable Function
299      45(stride):      7(ptr) Variable Function
300              26:      6(int) Load 11(pos)
301              28:     27(ptr) AccessChain 23(sbuf) 25 26
302              29:    19(sb_t) Load 28
303              30:   14(fvec3) CompositeExtract 29 0
304              32:     31(ptr) AccessChain 18(mydata) 25
305                              Store 32 30
306              33:      6(int) CompositeExtract 29 1
307              36:    15(bool) INotEqual 33 35
308              38:     37(ptr) AccessChain 18(mydata) 34
309                              Store 38 36
310              39:      6(int) CompositeExtract 29 2
311              41:    15(bool) INotEqual 39 35
312              42:     37(ptr) AccessChain 18(mydata) 40
313                              Store 42 41
314              44:      6(int) ArrayLength 23(sbuf) 0
315                              Store 43(size) 44
316                              Store 45(stride) 46
317              47:      6(int) Load 11(pos)
318              49:     48(ptr) AccessChain 23(sbuf) 25 47 34
319              50:      6(int) Load 49
320              51:    15(bool) INotEqual 50 35
321                              SelectionMerge 53 None
322                              BranchConditional 51 52 74
323              52:               Label
324              54:      6(int)   Load 11(pos)
325              56:     55(ptr)   AccessChain 23(sbuf) 25 54 25
326              57:   14(fvec3)   Load 56
327              62:      6(int)   Load 11(pos)
328              64:     63(ptr)   AccessChain 61(sbuf2) 25 62
329              65:    8(float)   Load 64
330              66:   14(fvec3)   CompositeConstruct 65 65 65
331              67:   14(fvec3)   FAdd 57 66
332              69:    8(float)   CompositeExtract 67 0
333              70:    8(float)   CompositeExtract 67 1
334              71:    8(float)   CompositeExtract 67 2
335              72:    9(fvec4)   CompositeConstruct 69 70 71 68
336                                ReturnValue 72
337              74:               Label
338              76:     75(ptr)   AccessChain 18(mydata) 25 35
339              77:    8(float)   Load 76
340              78:      6(int)   Load 43(size)
341              79:    8(float)   ConvertUToF 78
342              80:    8(float)   FAdd 77 79
343              81:      6(int)   Load 45(stride)
344              82:    8(float)   ConvertUToF 81
345              83:    8(float)   FAdd 80 82
346              84:    9(fvec4)   CompositeConstruct 83 83 83 83
347                                ReturnValue 84
348              53:             Label
349                              Unreachable
350                              FunctionEnd
351