yum-mirror/glslang

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

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

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