yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

Saddamfix oob read folding component-wise intrinsics on matricesa34e1ca5

main
11.7 KiB290 linesraw
1hlsl.constantfold.matrix.frag
2Shader version: 500
3gl_FragCoord origin is upper left
40:? Sequence
50:5  Function Definition: @main( ( temp 4-component vector of float)
60:5    Function Parameters: 
70:?     Sequence
80:6      Sequence
90:6        move second child to first child ( temp 2X2 matrix of float)
100:6          'mn' ( temp 2X2 matrix of float)
110:6          Constant:
120:6            1.000000
130:6            2.000000
140:6            2.000000
150:6            1.000000
160:7      Sequence
170:7        move second child to first child ( temp 2X2 matrix of float)
180:7          'mx' ( temp 2X2 matrix of float)
190:7          Constant:
200:7            4.000000
210:7            3.000000
220:7            3.000000
230:7            4.000000
240:8      Sequence
250:8        move second child to first child ( temp 2X2 matrix of float)
260:8          'cl' ( temp 2X2 matrix of float)
270:8          Constant:
280:8            1.000000
290:8            5.000000
300:8            8.000000
310:8            1.000000
320:9      Sequence
330:9        move second child to first child ( temp 2X2 matrix of float)
340:9          'lp' ( temp 2X2 matrix of float)
350:9          Constant:
360:9            1.000000
370:9            2.000000
380:9            3.000000
390:9            4.000000
400:10      Sequence
410:10        move second child to first child ( temp 2X2 matrix of float)
420:10          'st' ( temp 2X2 matrix of float)
430:10          Constant:
440:10            1.000000
450:10            1.000000
460:10            0.000000
470:10            0.000000
480:11      Sequence
490:11        move second child to first child ( temp 2X2 matrix of float)
500:11          'ss' ( temp 2X2 matrix of float)
510:11          Constant:
520:11            0.500000
530:11            0.500000
540:11            0.500000
550:11            0.500000
560:13      Branch: Return with expression
570:13        Construct vec4 ( temp 4-component vector of float)
580:13          add ( temp 2-component vector of float)
590:13            add ( temp 2-component vector of float)
600:13              add ( temp 2-component vector of float)
610:13                direct index ( temp 2-component vector of float)
620:13                  'mn' ( temp 2X2 matrix of float)
630:13                  Constant:
640:13                    0 (const int)
650:13                direct index ( temp 2-component vector of float)
660:13                  'mx' ( temp 2X2 matrix of float)
670:13                  Constant:
680:13                    0 (const int)
690:13              direct index ( temp 2-component vector of float)
700:13                'cl' ( temp 2X2 matrix of float)
710:13                Constant:
720:13                  0 (const int)
730:13            direct index ( temp 2-component vector of float)
740:13              'lp' ( temp 2X2 matrix of float)
750:13              Constant:
760:13                0 (const int)
770:13          add ( temp 2-component vector of float)
780:13            direct index ( temp 2-component vector of float)
790:13              'st' ( temp 2X2 matrix of float)
800:13              Constant:
810:13                0 (const int)
820:13            direct index ( temp 2-component vector of float)
830:13              'ss' ( temp 2X2 matrix of float)
840:13              Constant:
850:13                0 (const int)
860:5  Function Definition: main( ( temp void)
870:5    Function Parameters: 
880:?     Sequence
890:5      move second child to first child ( temp 4-component vector of float)
900:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
910:5        Function Call: @main( ( temp 4-component vector of float)
920:?   Linker Objects
930:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
94
95
96Linked fragment stage:
97
98
99Shader version: 500
100gl_FragCoord origin is upper left
1010:? Sequence
1020:5  Function Definition: @main( ( temp 4-component vector of float)
1030:5    Function Parameters: 
1040:?     Sequence
1050:6      Sequence
1060:6        move second child to first child ( temp 2X2 matrix of float)
1070:6          'mn' ( temp 2X2 matrix of float)
1080:6          Constant:
1090:6            1.000000
1100:6            2.000000
1110:6            2.000000
1120:6            1.000000
1130:7      Sequence
1140:7        move second child to first child ( temp 2X2 matrix of float)
1150:7          'mx' ( temp 2X2 matrix of float)
1160:7          Constant:
1170:7            4.000000
1180:7            3.000000
1190:7            3.000000
1200:7            4.000000
1210:8      Sequence
1220:8        move second child to first child ( temp 2X2 matrix of float)
1230:8          'cl' ( temp 2X2 matrix of float)
1240:8          Constant:
1250:8            1.000000
1260:8            5.000000
1270:8            8.000000
1280:8            1.000000
1290:9      Sequence
1300:9        move second child to first child ( temp 2X2 matrix of float)
1310:9          'lp' ( temp 2X2 matrix of float)
1320:9          Constant:
1330:9            1.000000
1340:9            2.000000
1350:9            3.000000
1360:9            4.000000
1370:10      Sequence
1380:10        move second child to first child ( temp 2X2 matrix of float)
1390:10          'st' ( temp 2X2 matrix of float)
1400:10          Constant:
1410:10            1.000000
1420:10            1.000000
1430:10            0.000000
1440:10            0.000000
1450:11      Sequence
1460:11        move second child to first child ( temp 2X2 matrix of float)
1470:11          'ss' ( temp 2X2 matrix of float)
1480:11          Constant:
1490:11            0.500000
1500:11            0.500000
1510:11            0.500000
1520:11            0.500000
1530:13      Branch: Return with expression
1540:13        Construct vec4 ( temp 4-component vector of float)
1550:13          add ( temp 2-component vector of float)
1560:13            add ( temp 2-component vector of float)
1570:13              add ( temp 2-component vector of float)
1580:13                direct index ( temp 2-component vector of float)
1590:13                  'mn' ( temp 2X2 matrix of float)
1600:13                  Constant:
1610:13                    0 (const int)
1620:13                direct index ( temp 2-component vector of float)
1630:13                  'mx' ( temp 2X2 matrix of float)
1640:13                  Constant:
1650:13                    0 (const int)
1660:13              direct index ( temp 2-component vector of float)
1670:13                'cl' ( temp 2X2 matrix of float)
1680:13                Constant:
1690:13                  0 (const int)
1700:13            direct index ( temp 2-component vector of float)
1710:13              'lp' ( temp 2X2 matrix of float)
1720:13              Constant:
1730:13                0 (const int)
1740:13          add ( temp 2-component vector of float)
1750:13            direct index ( temp 2-component vector of float)
1760:13              'st' ( temp 2X2 matrix of float)
1770:13              Constant:
1780:13                0 (const int)
1790:13            direct index ( temp 2-component vector of float)
1800:13              'ss' ( temp 2X2 matrix of float)
1810:13              Constant:
1820:13                0 (const int)
1830:5  Function Definition: main( ( temp void)
1840:5    Function Parameters: 
1850:?     Sequence
1860:5      move second child to first child ( temp 4-component vector of float)
1870:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
1880:5        Function Call: @main( ( temp 4-component vector of float)
1890:?   Linker Objects
1900:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
191
192// Module Version 10000
193// Generated by (magic number): 8000b
194// Id's are bound by 72
195
196                              Capability Shader
197               1:             ExtInstImport  "GLSL.std.450"
198                              MemoryModel Logical GLSL450
199                              EntryPoint Fragment 4  "main" 70
200                              ExecutionMode 4 OriginUpperLeft
201                              Source HLSL 500
202                              Name 4  "main"
203                              Name 9  "@main("
204                              Name 14  "mn"
205                              Name 20  "mx"
206                              Name 26  "cl"
207                              Name 32  "lp"
208                              Name 34  "st"
209                              Name 39  "ss"
210                              Name 70  "@entryPointOutput"
211                              Decorate 70(@entryPointOutput) Location 0
212               2:             TypeVoid
213               3:             TypeFunction 2
214               6:             TypeFloat 32
215               7:             TypeVector 6(float) 4
216               8:             TypeFunction 7(fvec4)
217              11:             TypeVector 6(float) 2
218              12:             TypeMatrix 11(fvec2) 2
219              13:             TypePointer Function 12
220              15:    6(float) Constant 1065353216
221              16:    6(float) Constant 1073741824
222              17:   11(fvec2) ConstantComposite 15 16
223              18:   11(fvec2) ConstantComposite 16 15
224              19:          12 ConstantComposite 17 18
225              21:    6(float) Constant 1082130432
226              22:    6(float) Constant 1077936128
227              23:   11(fvec2) ConstantComposite 21 22
228              24:   11(fvec2) ConstantComposite 22 21
229              25:          12 ConstantComposite 23 24
230              27:    6(float) Constant 1084227584
231              28:   11(fvec2) ConstantComposite 15 27
232              29:    6(float) Constant 1090519040
233              30:   11(fvec2) ConstantComposite 29 15
234              31:          12 ConstantComposite 28 30
235              33:          12 ConstantComposite 17 24
236              35:   11(fvec2) ConstantComposite 15 15
237              36:    6(float) Constant 0
238              37:   11(fvec2) ConstantComposite 36 36
239              38:          12 ConstantComposite 35 37
240              40:    6(float) Constant 1056964608
241              41:   11(fvec2) ConstantComposite 40 40
242              42:          12 ConstantComposite 41 41
243              43:             TypeInt 32 1
244              44:     43(int) Constant 0
245              45:             TypePointer Function 11(fvec2)
246              69:             TypePointer Output 7(fvec4)
24770(@entryPointOutput):     69(ptr) Variable Output
248         4(main):           2 Function None 3
249               5:             Label
250              71:    7(fvec4) FunctionCall 9(@main()
251                              Store 70(@entryPointOutput) 71
252                              Return
253                              FunctionEnd
254       9(@main():    7(fvec4) Function None 8
255              10:             Label
256          14(mn):     13(ptr) Variable Function
257          20(mx):     13(ptr) Variable Function
258          26(cl):     13(ptr) Variable Function
259          32(lp):     13(ptr) Variable Function
260          34(st):     13(ptr) Variable Function
261          39(ss):     13(ptr) Variable Function
262                              Store 14(mn) 19
263                              Store 20(mx) 25
264                              Store 26(cl) 31
265                              Store 32(lp) 33
266                              Store 34(st) 38
267                              Store 39(ss) 42
268              46:     45(ptr) AccessChain 14(mn) 44
269              47:   11(fvec2) Load 46
270              48:     45(ptr) AccessChain 20(mx) 44
271              49:   11(fvec2) Load 48
272              50:   11(fvec2) FAdd 47 49
273              51:     45(ptr) AccessChain 26(cl) 44
274              52:   11(fvec2) Load 51
275              53:   11(fvec2) FAdd 50 52
276              54:     45(ptr) AccessChain 32(lp) 44
277              55:   11(fvec2) Load 54
278              56:   11(fvec2) FAdd 53 55
279              57:     45(ptr) AccessChain 34(st) 44
280              58:   11(fvec2) Load 57
281              59:     45(ptr) AccessChain 39(ss) 44
282              60:   11(fvec2) Load 59
283              61:   11(fvec2) FAdd 58 60
284              62:    6(float) CompositeExtract 56 0
285              63:    6(float) CompositeExtract 56 1
286              64:    6(float) CompositeExtract 61 0
287              65:    6(float) CompositeExtract 61 1
288              66:    7(fvec4) CompositeConstruct 62 63 64 65
289                              ReturnValue 66
290                              FunctionEnd