yum-mirror/glslang

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

David NetoHLSL: handle type error for ternary operator (#4207)7d9fae2c

main
9.1 KiB202 linesraw
1hlsl.ternary.simple.frag
2Shader version: 500
3gl_FragCoord origin is upper left
40:? Sequence
50:2  Function Definition: @main(i1;i1;vf4;vf4; ( temp 4-component vector of float)
60:2    Function Parameters: 
70:2      'a' ( in int)
80:2      'b' ( in int)
90:2      'col0' ( in 4-component vector of float)
100:2      'col1' ( in 4-component vector of float)
110:?     Sequence
120:3      Branch: Return with expression
130:3        Test condition and select ( temp 4-component vector of float): no shortcircuit
140:3          Condition
150:3          Compare Less Than ( temp bool)
160:3            'a' ( in int)
170:3            'b' ( in int)
180:3          true case
190:3          'col0' ( in 4-component vector of float)
200:3          false case
210:3          'col1' ( in 4-component vector of float)
220:2  Function Definition: main( ( temp void)
230:2    Function Parameters: 
240:?     Sequence
250:2      move second child to first child ( temp int)
260:?         'a' ( temp int)
270:?         'a' (layout( location=0) flat in int)
280:2      move second child to first child ( temp int)
290:?         'b' ( temp int)
300:?         'b' (layout( location=1) flat in int)
310:2      move second child to first child ( temp 4-component vector of float)
320:?         'col0' ( temp 4-component vector of float)
330:?         'col0' (layout( location=2) in 4-component vector of float)
340:2      move second child to first child ( temp 4-component vector of float)
350:?         'col1' ( temp 4-component vector of float)
360:?         'col1' (layout( location=3) in 4-component vector of float)
370:2      move second child to first child ( temp 4-component vector of float)
380:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
390:2        Function Call: @main(i1;i1;vf4;vf4; ( temp 4-component vector of float)
400:?           'a' ( temp int)
410:?           'b' ( temp int)
420:?           'col0' ( temp 4-component vector of float)
430:?           'col1' ( temp 4-component vector of float)
440:?   Linker Objects
450:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
460:?     'a' (layout( location=0) flat in int)
470:?     'b' (layout( location=1) flat in int)
480:?     'col0' (layout( location=2) in 4-component vector of float)
490:?     'col1' (layout( location=3) in 4-component vector of float)
50
51
52Linked fragment stage:
53
54
55Shader version: 500
56gl_FragCoord origin is upper left
570:? Sequence
580:2  Function Definition: @main(i1;i1;vf4;vf4; ( temp 4-component vector of float)
590:2    Function Parameters: 
600:2      'a' ( in int)
610:2      'b' ( in int)
620:2      'col0' ( in 4-component vector of float)
630:2      'col1' ( in 4-component vector of float)
640:?     Sequence
650:3      Branch: Return with expression
660:3        Test condition and select ( temp 4-component vector of float): no shortcircuit
670:3          Condition
680:3          Compare Less Than ( temp bool)
690:3            'a' ( in int)
700:3            'b' ( in int)
710:3          true case
720:3          'col0' ( in 4-component vector of float)
730:3          false case
740:3          'col1' ( in 4-component vector of float)
750:2  Function Definition: main( ( temp void)
760:2    Function Parameters: 
770:?     Sequence
780:2      move second child to first child ( temp int)
790:?         'a' ( temp int)
800:?         'a' (layout( location=0) flat in int)
810:2      move second child to first child ( temp int)
820:?         'b' ( temp int)
830:?         'b' (layout( location=1) flat in int)
840:2      move second child to first child ( temp 4-component vector of float)
850:?         'col0' ( temp 4-component vector of float)
860:?         'col0' (layout( location=2) in 4-component vector of float)
870:2      move second child to first child ( temp 4-component vector of float)
880:?         'col1' ( temp 4-component vector of float)
890:?         'col1' (layout( location=3) in 4-component vector of float)
900:2      move second child to first child ( temp 4-component vector of float)
910:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
920:2        Function Call: @main(i1;i1;vf4;vf4; ( temp 4-component vector of float)
930:?           'a' ( temp int)
940:?           'b' ( temp int)
950:?           'col0' ( temp 4-component vector of float)
960:?           'col1' ( temp 4-component vector of float)
970:?   Linker Objects
980:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
990:?     'a' (layout( location=0) flat in int)
1000:?     'b' (layout( location=1) flat in int)
1010:?     'col0' (layout( location=2) in 4-component vector of float)
1020:?     'col1' (layout( location=3) in 4-component vector of float)
103
104// Module Version 10000
105// Generated by (magic number): 8000b
106// Id's are bound by 54
107
108                              Capability Shader
109               1:             ExtInstImport  "GLSL.std.450"
110                              MemoryModel Logical GLSL450
111                              EntryPoint Fragment 4  "main" 31 34 38 41 44
112                              ExecutionMode 4 OriginUpperLeft
113                              Source HLSL 500
114                              Name 4  "main"
115                              Name 16  "@main(i1;i1;vf4;vf4;"
116                              Name 12  "a"
117                              Name 13  "b"
118                              Name 14  "col0"
119                              Name 15  "col1"
120                              Name 29  "a"
121                              Name 31  "a"
122                              Name 33  "b"
123                              Name 34  "b"
124                              Name 36  "col0"
125                              Name 38  "col0"
126                              Name 40  "col1"
127                              Name 41  "col1"
128                              Name 44  "@entryPointOutput"
129                              Name 45  "param"
130                              Name 47  "param"
131                              Name 49  "param"
132                              Name 51  "param"
133                              Decorate 31(a) Flat
134                              Decorate 31(a) Location 0
135                              Decorate 34(b) Flat
136                              Decorate 34(b) Location 1
137                              Decorate 38(col0) Location 2
138                              Decorate 41(col1) Location 3
139                              Decorate 44(@entryPointOutput) Location 0
140               2:             TypeVoid
141               3:             TypeFunction 2
142               6:             TypeInt 32 1
143               7:             TypePointer Function 6(int)
144               8:             TypeFloat 32
145               9:             TypeVector 8(float) 4
146              10:             TypePointer Function 9(fvec4)
147              11:             TypeFunction 9(fvec4) 7(ptr) 7(ptr) 10(ptr) 10(ptr)
148              20:             TypeBool
149              24:             TypeVector 20(bool) 4
150              30:             TypePointer Input 6(int)
151           31(a):     30(ptr) Variable Input
152           34(b):     30(ptr) Variable Input
153              37:             TypePointer Input 9(fvec4)
154        38(col0):     37(ptr) Variable Input
155        41(col1):     37(ptr) Variable Input
156              43:             TypePointer Output 9(fvec4)
15744(@entryPointOutput):     43(ptr) Variable Output
158         4(main):           2 Function None 3
159               5:             Label
160           29(a):      7(ptr) Variable Function
161           33(b):      7(ptr) Variable Function
162        36(col0):     10(ptr) Variable Function
163        40(col1):     10(ptr) Variable Function
164       45(param):      7(ptr) Variable Function
165       47(param):      7(ptr) Variable Function
166       49(param):     10(ptr) Variable Function
167       51(param):     10(ptr) Variable Function
168              32:      6(int) Load 31(a)
169                              Store 29(a) 32
170              35:      6(int) Load 34(b)
171                              Store 33(b) 35
172              39:    9(fvec4) Load 38(col0)
173                              Store 36(col0) 39
174              42:    9(fvec4) Load 41(col1)
175                              Store 40(col1) 42
176              46:      6(int) Load 29(a)
177                              Store 45(param) 46
178              48:      6(int) Load 33(b)
179                              Store 47(param) 48
180              50:    9(fvec4) Load 36(col0)
181                              Store 49(param) 50
182              52:    9(fvec4) Load 40(col1)
183                              Store 51(param) 52
184              53:    9(fvec4) FunctionCall 16(@main(i1;i1;vf4;vf4;) 45(param) 47(param) 49(param) 51(param)
185                              Store 44(@entryPointOutput) 53
186                              Return
187                              FunctionEnd
18816(@main(i1;i1;vf4;vf4;):    9(fvec4) Function None 11
189           12(a):      7(ptr) FunctionParameter
190           13(b):      7(ptr) FunctionParameter
191        14(col0):     10(ptr) FunctionParameter
192        15(col1):     10(ptr) FunctionParameter
193              17:             Label
194              18:      6(int) Load 12(a)
195              19:      6(int) Load 13(b)
196              21:    20(bool) SLessThan 18 19
197              22:    9(fvec4) Load 14(col0)
198              23:    9(fvec4) Load 15(col1)
199              25:   24(bvec4) CompositeConstruct 21 21 21 21
200              26:    9(fvec4) Select 25 22 23
201                              ReturnValue 26
202                              FunctionEnd