HLSL: support per control point patch const fn invocation
[platform/upstream/glslang.git] / Test / baseResults / hlsl.hull.1.tesc.out
1 hlsl.hull.1.tesc
2 Shader version: 450
3 vertices = 4
4 0:? Sequence
5 0:26  Function Definition: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint})
6 0:26    Function Parameters: 
7 0:26      'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint})
8 0:26      'm_cpid' ( in uint)
9 0:?     Sequence
10 0:28      move second child to first child ( temp 3-component vector of float)
11 0:28        cpoint: direct index for structure ( temp 3-component vector of float)
12 0:28          'output' ( temp structure{ temp 3-component vector of float cpoint})
13 0:28          Constant:
14 0:28            0 (const int)
15 0:28        cpoint: direct index for structure ( temp 3-component vector of float)
16 0:28          direct index ( temp structure{ temp 3-component vector of float cpoint})
17 0:28            'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint})
18 0:28            Constant:
19 0:28              0 (const int)
20 0:28          Constant:
21 0:28            0 (const int)
22 0:29      Branch: Return with expression
23 0:29        'output' ( temp structure{ temp 3-component vector of float cpoint})
24 0:26  Function Definition: main( ( temp void)
25 0:26    Function Parameters: 
26 0:?     Sequence
27 0:26      move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
28 0:?         'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
29 0:?         'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
30 0:26      move second child to first child ( temp uint)
31 0:?         'm_cpid' ( temp uint)
32 0:?         'm_cpid' ( in uint InvocationID)
33 0:26      move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
34 0:?         '@entryPointOutput' (layout( location=0) out structure{ temp 3-component vector of float cpoint})
35 0:26        Function Call: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint})
36 0:?           'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
37 0:?           'm_cpid' ( temp uint)
38 0:?       Barrier ( temp void)
39 0:?       Test condition and select ( temp void)
40 0:?         Condition
41 0:?         Compare Equal ( temp bool)
42 0:?           'm_cpid' ( in uint InvocationID)
43 0:?           Constant:
44 0:?             0 (const int)
45 0:?         true case
46 0:?         Sequence
47 0:?           move second child to first child ( temp structure{ temp 2-element array of float edges})
48 0:?             '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
49 0:?             Function Call: PCF(u1; ( temp structure{ temp 2-element array of float edges})
50 0:?               'pid' ( in uint PrimitiveID)
51 0:?           Sequence
52 0:?             move second child to first child ( temp float)
53 0:?               direct index ( patch out float TessLevelOuter)
54 0:?                 '@patchConstantOutput_edges' ( patch out 2-element array of float TessLevelOuter)
55 0:?                 Constant:
56 0:?                   0 (const int)
57 0:?               direct index ( temp float)
58 0:?                 edges: direct index for structure ( temp 2-element array of float)
59 0:?                   '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
60 0:?                   Constant:
61 0:?                     0 (const int)
62 0:?                 Constant:
63 0:?                   0 (const int)
64 0:?             move second child to first child ( temp float)
65 0:?               direct index ( patch out float TessLevelOuter)
66 0:?                 '@patchConstantOutput_edges' ( patch out 2-element array of float TessLevelOuter)
67 0:?                 Constant:
68 0:?                   1 (const int)
69 0:?               direct index ( temp float)
70 0:?                 edges: direct index for structure ( temp 2-element array of float)
71 0:?                   '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
72 0:?                   Constant:
73 0:?                     0 (const int)
74 0:?                 Constant:
75 0:?                   1 (const int)
76 0:33  Function Definition: PCF(u1; ( temp structure{ temp 2-element array of float edges})
77 0:33    Function Parameters: 
78 0:33      'pid' ( in uint)
79 0:?     Sequence
80 0:36      move second child to first child ( temp float)
81 0:36        direct index ( temp float)
82 0:36          edges: direct index for structure ( temp 2-element array of float)
83 0:36            'output' ( temp structure{ temp 2-element array of float edges})
84 0:36            Constant:
85 0:36              0 (const int)
86 0:36          Constant:
87 0:36            0 (const int)
88 0:36        Constant:
89 0:36          2.000000
90 0:37      move second child to first child ( temp float)
91 0:37        direct index ( temp float)
92 0:37          edges: direct index for structure ( temp 2-element array of float)
93 0:37            'output' ( temp structure{ temp 2-element array of float edges})
94 0:37            Constant:
95 0:37              0 (const int)
96 0:37          Constant:
97 0:37            1 (const int)
98 0:37        Constant:
99 0:37          8.000000
100 0:38      Branch: Return with expression
101 0:38        'output' ( temp structure{ temp 2-element array of float edges})
102 0:?   Linker Objects
103 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 3-component vector of float cpoint})
104 0:?     'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
105 0:?     'm_cpid' ( in uint InvocationID)
106 0:?     'pid' ( in uint PrimitiveID)
107 0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
108 0:?     '@patchConstantOutput_edges' ( patch out 2-element array of float TessLevelOuter)
109
110
111 Linked tessellation control stage:
112
113
114 Shader version: 450
115 vertices = 4
116 0:? Sequence
117 0:26  Function Definition: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint})
118 0:26    Function Parameters: 
119 0:26      'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint})
120 0:26      'm_cpid' ( in uint)
121 0:?     Sequence
122 0:28      move second child to first child ( temp 3-component vector of float)
123 0:28        cpoint: direct index for structure ( temp 3-component vector of float)
124 0:28          'output' ( temp structure{ temp 3-component vector of float cpoint})
125 0:28          Constant:
126 0:28            0 (const int)
127 0:28        cpoint: direct index for structure ( temp 3-component vector of float)
128 0:28          direct index ( temp structure{ temp 3-component vector of float cpoint})
129 0:28            'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint})
130 0:28            Constant:
131 0:28              0 (const int)
132 0:28          Constant:
133 0:28            0 (const int)
134 0:29      Branch: Return with expression
135 0:29        'output' ( temp structure{ temp 3-component vector of float cpoint})
136 0:26  Function Definition: main( ( temp void)
137 0:26    Function Parameters: 
138 0:?     Sequence
139 0:26      move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
140 0:?         'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
141 0:?         'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
142 0:26      move second child to first child ( temp uint)
143 0:?         'm_cpid' ( temp uint)
144 0:?         'm_cpid' ( in uint InvocationID)
145 0:26      move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
146 0:?         '@entryPointOutput' (layout( location=0) out structure{ temp 3-component vector of float cpoint})
147 0:26        Function Call: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint})
148 0:?           'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
149 0:?           'm_cpid' ( temp uint)
150 0:?       Barrier ( temp void)
151 0:?       Test condition and select ( temp void)
152 0:?         Condition
153 0:?         Compare Equal ( temp bool)
154 0:?           'm_cpid' ( in uint InvocationID)
155 0:?           Constant:
156 0:?             0 (const int)
157 0:?         true case
158 0:?         Sequence
159 0:?           move second child to first child ( temp structure{ temp 2-element array of float edges})
160 0:?             '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
161 0:?             Function Call: PCF(u1; ( temp structure{ temp 2-element array of float edges})
162 0:?               'pid' ( in uint PrimitiveID)
163 0:?           Sequence
164 0:?             move second child to first child ( temp float)
165 0:?               direct index ( patch out float TessLevelOuter)
166 0:?                 '@patchConstantOutput_edges' ( patch out 2-element array of float TessLevelOuter)
167 0:?                 Constant:
168 0:?                   0 (const int)
169 0:?               direct index ( temp float)
170 0:?                 edges: direct index for structure ( temp 2-element array of float)
171 0:?                   '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
172 0:?                   Constant:
173 0:?                     0 (const int)
174 0:?                 Constant:
175 0:?                   0 (const int)
176 0:?             move second child to first child ( temp float)
177 0:?               direct index ( patch out float TessLevelOuter)
178 0:?                 '@patchConstantOutput_edges' ( patch out 2-element array of float TessLevelOuter)
179 0:?                 Constant:
180 0:?                   1 (const int)
181 0:?               direct index ( temp float)
182 0:?                 edges: direct index for structure ( temp 2-element array of float)
183 0:?                   '@patchConstantResult' ( temp structure{ temp 2-element array of float edges})
184 0:?                   Constant:
185 0:?                     0 (const int)
186 0:?                 Constant:
187 0:?                   1 (const int)
188 0:33  Function Definition: PCF(u1; ( temp structure{ temp 2-element array of float edges})
189 0:33    Function Parameters: 
190 0:33      'pid' ( in uint)
191 0:?     Sequence
192 0:36      move second child to first child ( temp float)
193 0:36        direct index ( temp float)
194 0:36          edges: direct index for structure ( temp 2-element array of float)
195 0:36            'output' ( temp structure{ temp 2-element array of float edges})
196 0:36            Constant:
197 0:36              0 (const int)
198 0:36          Constant:
199 0:36            0 (const int)
200 0:36        Constant:
201 0:36          2.000000
202 0:37      move second child to first child ( temp float)
203 0:37        direct index ( temp float)
204 0:37          edges: direct index for structure ( temp 2-element array of float)
205 0:37            'output' ( temp structure{ temp 2-element array of float edges})
206 0:37            Constant:
207 0:37              0 (const int)
208 0:37          Constant:
209 0:37            1 (const int)
210 0:37        Constant:
211 0:37          8.000000
212 0:38      Branch: Return with expression
213 0:38        'output' ( temp structure{ temp 2-element array of float edges})
214 0:?   Linker Objects
215 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 3-component vector of float cpoint})
216 0:?     'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
217 0:?     'm_cpid' ( in uint InvocationID)
218 0:?     'pid' ( in uint PrimitiveID)
219 0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
220 0:?     '@patchConstantOutput_edges' ( patch out 2-element array of float TessLevelOuter)
221
222 // Module Version 10000
223 // Generated by (magic number): 80001
224 // Id's are bound by 88
225
226                               Capability Tessellation
227                1:             ExtInstImport  "GLSL.std.450"
228                               MemoryModel Logical GLSL450
229                               EntryPoint TessellationControl 4  "main" 40 44 47 62 67 87
230                               ExecutionMode 4 OutputVertices 4
231                               Name 4  "main"
232                               Name 8  "VS_OUT"
233                               MemberName 8(VS_OUT) 0  "cpoint"
234                               Name 14  "HS_OUT"
235                               MemberName 14(HS_OUT) 0  "cpoint"
236                               Name 18  "@main(struct-VS_OUT-vf31[4];u1;"
237                               Name 16  "ip"
238                               Name 17  "m_cpid"
239                               Name 22  "HS_CONSTANT_OUT"
240                               MemberName 22(HS_CONSTANT_OUT) 0  "edges"
241                               Name 25  "PCF(u1;"
242                               Name 24  "pid"
243                               Name 28  "output"
244                               Name 38  "ip"
245                               Name 40  "ip"
246                               Name 42  "m_cpid"
247                               Name 44  "m_cpid"
248                               Name 47  "@entryPointOutput"
249                               Name 48  "param"
250                               Name 50  "param"
251                               Name 61  "@patchConstantResult"
252                               Name 62  "pid"
253                               Name 63  "param"
254                               Name 67  "@patchConstantOutput_edges"
255                               Name 77  "output"
256                               Name 85  "HS_CONSTANT_OUT"
257                               Name 87  "@patchConstantOutput"
258                               Decorate 40(ip) Location 0
259                               Decorate 44(m_cpid) BuiltIn InvocationId
260                               Decorate 47(@entryPointOutput) Location 0
261                               Decorate 62(pid) BuiltIn PrimitiveId
262                               Decorate 67(@patchConstantOutput_edges) Patch
263                               Decorate 67(@patchConstantOutput_edges) BuiltIn TessLevelOuter
264                               Decorate 87(@patchConstantOutput) Patch
265                               Decorate 87(@patchConstantOutput) Location 1
266                2:             TypeVoid
267                3:             TypeFunction 2
268                6:             TypeFloat 32
269                7:             TypeVector 6(float) 3
270        8(VS_OUT):             TypeStruct 7(fvec3)
271                9:             TypeInt 32 0
272               10:      9(int) Constant 4
273               11:             TypeArray 8(VS_OUT) 10
274               12:             TypePointer Function 11
275               13:             TypePointer Function 9(int)
276       14(HS_OUT):             TypeStruct 7(fvec3)
277               15:             TypeFunction 14(HS_OUT) 12(ptr) 13(ptr)
278               20:      9(int) Constant 2
279               21:             TypeArray 6(float) 20
280 22(HS_CONSTANT_OUT):             TypeStruct 21
281               23:             TypeFunction 22(HS_CONSTANT_OUT) 13(ptr)
282               27:             TypePointer Function 14(HS_OUT)
283               29:             TypeInt 32 1
284               30:     29(int) Constant 0
285               31:             TypePointer Function 7(fvec3)
286               39:             TypePointer Input 11
287           40(ip):     39(ptr) Variable Input
288               43:             TypePointer Input 9(int)
289       44(m_cpid):     43(ptr) Variable Input
290               46:             TypePointer Output 14(HS_OUT)
291 47(@entryPointOutput):     46(ptr) Variable Output
292               53:      9(int) Constant 1
293               54:      9(int) Constant 0
294               56:             TypeBool
295               60:             TypePointer Function 22(HS_CONSTANT_OUT)
296          62(pid):     43(ptr) Variable Input
297               66:             TypePointer Output 21
298 67(@patchConstantOutput_edges):     66(ptr) Variable Output
299               68:             TypePointer Function 6(float)
300               71:             TypePointer Output 6(float)
301               73:     29(int) Constant 1
302               78:    6(float) Constant 1073741824
303               80:    6(float) Constant 1090519040
304 85(HS_CONSTANT_OUT):             TypeStruct
305               86:             TypePointer Output 85(HS_CONSTANT_OUT)
306 87(@patchConstantOutput):     86(ptr) Variable Output
307          4(main):           2 Function None 3
308                5:             Label
309           38(ip):     12(ptr) Variable Function
310       42(m_cpid):     13(ptr) Variable Function
311        48(param):     12(ptr) Variable Function
312        50(param):     13(ptr) Variable Function
313 61(@patchConstantResult):     60(ptr) Variable Function
314        63(param):     13(ptr) Variable Function
315               41:          11 Load 40(ip)
316                               Store 38(ip) 41
317               45:      9(int) Load 44(m_cpid)
318                               Store 42(m_cpid) 45
319               49:          11 Load 38(ip)
320                               Store 48(param) 49
321               51:      9(int) Load 42(m_cpid)
322                               Store 50(param) 51
323               52:  14(HS_OUT) FunctionCall 18(@main(struct-VS_OUT-vf31[4];u1;) 48(param) 50(param)
324                               Store 47(@entryPointOutput) 52
325                               ControlBarrier 20 53 54
326               55:      9(int) Load 44(m_cpid)
327               57:    56(bool) IEqual 55 30
328                               SelectionMerge 59 None
329                               BranchConditional 57 58 59
330               58:               Label
331               64:      9(int)   Load 62(pid)
332                                 Store 63(param) 64
333               65:22(HS_CONSTANT_OUT)   FunctionCall 25(PCF(u1;) 63(param)
334                                 Store 61(@patchConstantResult) 65
335               69:     68(ptr)   AccessChain 61(@patchConstantResult) 30 30
336               70:    6(float)   Load 69
337               72:     71(ptr)   AccessChain 67(@patchConstantOutput_edges) 30
338                                 Store 72 70
339               74:     68(ptr)   AccessChain 61(@patchConstantResult) 30 73
340               75:    6(float)   Load 74
341               76:     71(ptr)   AccessChain 67(@patchConstantOutput_edges) 73
342                                 Store 76 75
343                                 Branch 59
344               59:             Label
345                               Return
346                               FunctionEnd
347 18(@main(struct-VS_OUT-vf31[4];u1;):  14(HS_OUT) Function None 15
348           16(ip):     12(ptr) FunctionParameter
349       17(m_cpid):     13(ptr) FunctionParameter
350               19:             Label
351       28(output):     27(ptr) Variable Function
352               32:     31(ptr) AccessChain 16(ip) 30 30
353               33:    7(fvec3) Load 32
354               34:     31(ptr) AccessChain 28(output) 30
355                               Store 34 33
356               35:  14(HS_OUT) Load 28(output)
357                               ReturnValue 35
358                               FunctionEnd
359      25(PCF(u1;):22(HS_CONSTANT_OUT) Function None 23
360          24(pid):     13(ptr) FunctionParameter
361               26:             Label
362       77(output):     60(ptr) Variable Function
363               79:     68(ptr) AccessChain 77(output) 30 30
364                               Store 79 78
365               81:     68(ptr) AccessChain 77(output) 30 73
366                               Store 81 80
367               82:22(HS_CONSTANT_OUT) Load 77(output)
368                               ReturnValue 82
369                               FunctionEnd