blob: 992783eb302acaed26c7dbf7e07a97827033b5f4 [file] [log] [blame]
dan sinclair1b77b6c2024-08-06 15:47:05 +00001; SPIR-V
2; Version: 1.3
3; Generator: Google Tint Compiler; 1
Peter McNeeley4c92f4b2024-08-20 19:16:36 +00004; Bound: 277
dan sinclair1b77b6c2024-08-06 15:47:05 +00005; Schema: 0
6 OpCapability Shader
7 %40 = OpExtInstImport "GLSL.std.450"
8 OpMemoryModel Logical GLSL450
9 OpEntryPoint Vertex %vert_main "vert_main" %vert_main_loc0_Input %vert_main_loc1_Input %vert_main_loc2_Input %vert_main_position_Output %vert_main___point_size_Output
10 OpEntryPoint Fragment %frag_main "frag_main" %frag_main_loc0_Output
11 OpEntryPoint GLCompute %comp_main "comp_main" %comp_main_global_invocation_id_Input
12 OpExecutionMode %frag_main OriginUpperLeft
13 OpExecutionMode %comp_main LocalSize 1 1 1
14 OpMemberName %SimParams 0 "deltaT"
15 OpMemberName %SimParams 1 "rule1Distance"
16 OpMemberName %SimParams 2 "rule2Distance"
17 OpMemberName %SimParams 3 "rule3Distance"
18 OpMemberName %SimParams 4 "rule1Scale"
19 OpMemberName %SimParams 5 "rule2Scale"
20 OpMemberName %SimParams 6 "rule3Scale"
21 OpName %SimParams "SimParams"
22 OpMemberName %tint_symbol_1 0 "tint_symbol"
23 OpName %tint_symbol_1 "tint_symbol_1"
24 OpMemberName %Particle 0 "pos"
25 OpMemberName %Particle 1 "vel"
26 OpName %Particle "Particle"
27 OpMemberName %Particles 0 "particles"
28 OpName %Particles "Particles"
29 OpMemberName %tint_symbol_3 0 "tint_symbol_2"
30 OpName %tint_symbol_3 "tint_symbol_3"
31 OpMemberName %tint_symbol_5 0 "tint_symbol_4"
32 OpName %tint_symbol_5 "tint_symbol_5"
33 OpName %vert_main_loc0_Input "vert_main_loc0_Input"
34 OpName %vert_main_loc1_Input "vert_main_loc1_Input"
35 OpName %vert_main_loc2_Input "vert_main_loc2_Input"
36 OpName %vert_main_position_Output "vert_main_position_Output"
37 OpName %vert_main___point_size_Output "vert_main___point_size_Output"
38 OpName %frag_main_loc0_Output "frag_main_loc0_Output"
39 OpName %comp_main_global_invocation_id_Input "comp_main_global_invocation_id_Input"
40 OpName %vert_main_inner "vert_main_inner"
41 OpName %a_particlePos "a_particlePos"
42 OpName %a_particleVel "a_particleVel"
43 OpName %a_pos "a_pos"
44 OpName %angle "angle"
45 OpName %pos "pos"
46 OpName %frag_main_inner "frag_main_inner"
47 OpName %comp_main_inner "comp_main_inner"
48 OpName %gl_GlobalInvocationID "gl_GlobalInvocationID"
dan sinclair1b77b6c2024-08-06 15:47:05 +000049 OpName %index "index"
50 OpName %vPos "vPos"
51 OpName %vVel "vVel"
52 OpName %cMass "cMass"
53 OpName %cVel "cVel"
54 OpName %colVel "colVel"
55 OpName %cMassCount "cMassCount"
56 OpName %cVelCount "cVelCount"
57 OpName %pos_0 "pos"
58 OpName %vel "vel"
59 OpName %i "i"
60 OpName %vert_main "vert_main"
61 OpName %frag_main "frag_main"
62 OpName %comp_main "comp_main"
63 OpMemberDecorate %SimParams 0 Offset 0
64 OpMemberDecorate %SimParams 1 Offset 4
65 OpMemberDecorate %SimParams 2 Offset 8
66 OpMemberDecorate %SimParams 3 Offset 12
67 OpMemberDecorate %SimParams 4 Offset 16
68 OpMemberDecorate %SimParams 5 Offset 20
69 OpMemberDecorate %SimParams 6 Offset 24
70 OpMemberDecorate %tint_symbol_1 0 Offset 0
71 OpDecorate %tint_symbol_1 Block
72 OpDecorate %1 DescriptorSet 0
73 OpDecorate %1 Binding 0
74 OpDecorate %1 NonWritable
75 OpMemberDecorate %Particle 0 Offset 0
76 OpMemberDecorate %Particle 1 Offset 8
77 OpDecorate %_arr_Particle_uint_5 ArrayStride 16
78 OpMemberDecorate %Particles 0 Offset 0
79 OpMemberDecorate %tint_symbol_3 0 Offset 0
80 OpDecorate %tint_symbol_3 Block
81 OpDecorate %6 DescriptorSet 0
82 OpDecorate %6 Binding 1
dan sinclaird117d652024-08-21 01:20:00 +000083 OpDecorate %6 Coherent
dan sinclair1b77b6c2024-08-06 15:47:05 +000084 OpMemberDecorate %tint_symbol_5 0 Offset 0
85 OpDecorate %tint_symbol_5 Block
86 OpDecorate %15 DescriptorSet 0
87 OpDecorate %15 Binding 2
dan sinclaird117d652024-08-21 01:20:00 +000088 OpDecorate %15 Coherent
dan sinclair1b77b6c2024-08-06 15:47:05 +000089 OpDecorate %vert_main_loc0_Input Location 0
90 OpDecorate %vert_main_loc1_Input Location 1
91 OpDecorate %vert_main_loc2_Input Location 2
92 OpDecorate %vert_main_position_Output BuiltIn Position
93 OpDecorate %vert_main___point_size_Output BuiltIn PointSize
94 OpDecorate %frag_main_loc0_Output Location 0
95 OpDecorate %comp_main_global_invocation_id_Input BuiltIn GlobalInvocationId
96 %float = OpTypeFloat 32
97 %SimParams = OpTypeStruct %float %float %float %float %float %float %float
98%tint_symbol_1 = OpTypeStruct %SimParams
99%_ptr_Uniform_tint_symbol_1 = OpTypePointer Uniform %tint_symbol_1
100 %1 = OpVariable %_ptr_Uniform_tint_symbol_1 Uniform
101 %v2float = OpTypeVector %float 2
102 %Particle = OpTypeStruct %v2float %v2float
103 %uint = OpTypeInt 32 0
104 %uint_5 = OpConstant %uint 5
105%_arr_Particle_uint_5 = OpTypeArray %Particle %uint_5
106 %Particles = OpTypeStruct %_arr_Particle_uint_5
107%tint_symbol_3 = OpTypeStruct %Particles
108%_ptr_StorageBuffer_tint_symbol_3 = OpTypePointer StorageBuffer %tint_symbol_3
109 %6 = OpVariable %_ptr_StorageBuffer_tint_symbol_3 StorageBuffer
110%tint_symbol_5 = OpTypeStruct %Particles
111%_ptr_StorageBuffer_tint_symbol_5 = OpTypePointer StorageBuffer %tint_symbol_5
112 %15 = OpVariable %_ptr_StorageBuffer_tint_symbol_5 StorageBuffer
113%_ptr_Input_v2float = OpTypePointer Input %v2float
114%vert_main_loc0_Input = OpVariable %_ptr_Input_v2float Input
115%vert_main_loc1_Input = OpVariable %_ptr_Input_v2float Input
116%vert_main_loc2_Input = OpVariable %_ptr_Input_v2float Input
117 %v4float = OpTypeVector %float 4
118%_ptr_Output_v4float = OpTypePointer Output %v4float
119%vert_main_position_Output = OpVariable %_ptr_Output_v4float Output
120%_ptr_Output_float = OpTypePointer Output %float
121%vert_main___point_size_Output = OpVariable %_ptr_Output_float Output
122%frag_main_loc0_Output = OpVariable %_ptr_Output_v4float Output
123 %v3uint = OpTypeVector %uint 3
124%_ptr_Input_v3uint = OpTypePointer Input %v3uint
125%comp_main_global_invocation_id_Input = OpVariable %_ptr_Input_v3uint Input
126 %35 = OpTypeFunction %v4float %v2float %v2float %v2float
127%_ptr_Function_float = OpTypePointer Function %float
128%_ptr_Function_v2float = OpTypePointer Function %v2float
129 %float_0 = OpConstant %float 0
130 %float_1 = OpConstant %float 1
131 %71 = OpTypeFunction %v4float
132 %73 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
133 %void = OpTypeVoid
134 %77 = OpTypeFunction %void %v3uint
dan sinclair1b77b6c2024-08-06 15:47:05 +0000135%_ptr_Function_uint = OpTypePointer Function %uint
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000136 %bool = OpTypeBool
dan sinclair1b77b6c2024-08-06 15:47:05 +0000137%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
138 %uint_0 = OpConstant %uint 0
139 %uint_1 = OpConstant %uint 1
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000140 %99 = OpConstantNull %v2float
dan sinclair1b77b6c2024-08-06 15:47:05 +0000141 %int = OpTypeInt 32 1
142%_ptr_Function_int = OpTypePointer Function %int
143 %int_0 = OpConstant %int 0
144%_ptr_Uniform_float = OpTypePointer Uniform %float
145 %int_1 = OpConstant %int 1
146 %uint_2 = OpConstant %uint 2
147 %uint_3 = OpConstant %uint 3
148 %uint_4 = OpConstant %uint 4
149 %uint_6 = OpConstant %uint 6
150%float_0_100000001 = OpConstant %float 0.100000001
151 %float_n1 = OpConstant %float -1
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000152 %264 = OpTypeFunction %void
dan sinclair1b77b6c2024-08-06 15:47:05 +0000153%vert_main_inner = OpFunction %v4float None %35
154%a_particlePos = OpFunctionParameter %v2float
155%a_particleVel = OpFunctionParameter %v2float
156 %a_pos = OpFunctionParameter %v2float
157 %36 = OpLabel
158 %angle = OpVariable %_ptr_Function_float Function
159 %pos = OpVariable %_ptr_Function_v2float Function
160 %37 = OpCompositeExtract %float %a_particleVel 0
161 %38 = OpCompositeExtract %float %a_particleVel 1
162 %39 = OpExtInst %float %40 Atan2 %37 %38
163 %41 = OpFNegate %float %39
164 OpStore %angle %41
165 %44 = OpCompositeExtract %float %a_pos 0
dan sinclair50260412024-08-28 19:43:27 +0000166 %45 = OpLoad %float %angle None
dan sinclair1b77b6c2024-08-06 15:47:05 +0000167 %46 = OpExtInst %float %40 Cos %45
168 %47 = OpFMul %float %44 %46
169 %48 = OpCompositeExtract %float %a_pos 1
dan sinclair50260412024-08-28 19:43:27 +0000170 %49 = OpLoad %float %angle None
dan sinclair1b77b6c2024-08-06 15:47:05 +0000171 %50 = OpExtInst %float %40 Sin %49
172 %51 = OpFMul %float %48 %50
173 %52 = OpFSub %float %47 %51
174 %53 = OpCompositeExtract %float %a_pos 0
dan sinclair50260412024-08-28 19:43:27 +0000175 %54 = OpLoad %float %angle None
dan sinclair1b77b6c2024-08-06 15:47:05 +0000176 %55 = OpExtInst %float %40 Sin %54
177 %56 = OpFMul %float %53 %55
178 %57 = OpCompositeExtract %float %a_pos 1
dan sinclair50260412024-08-28 19:43:27 +0000179 %58 = OpLoad %float %angle None
dan sinclair1b77b6c2024-08-06 15:47:05 +0000180 %59 = OpExtInst %float %40 Cos %58
181 %60 = OpFMul %float %57 %59
182 %61 = OpFAdd %float %56 %60
183 %62 = OpCompositeConstruct %v2float %52 %61
184 OpStore %pos %62
dan sinclair50260412024-08-28 19:43:27 +0000185 %65 = OpLoad %v2float %pos None
dan sinclair1b77b6c2024-08-06 15:47:05 +0000186 %66 = OpFAdd %v2float %65 %a_particlePos
187 %67 = OpCompositeConstruct %v4float %66 %float_0 %float_1
188 OpReturnValue %67
189 OpFunctionEnd
190%frag_main_inner = OpFunction %v4float None %71
191 %72 = OpLabel
192 OpReturnValue %73
193 OpFunctionEnd
194%comp_main_inner = OpFunction %void None %77
195%gl_GlobalInvocationID = OpFunctionParameter %v3uint
196 %78 = OpLabel
dan sinclair1b77b6c2024-08-06 15:47:05 +0000197 %index = OpVariable %_ptr_Function_uint Function
198 %vPos = OpVariable %_ptr_Function_v2float Function
199 %vVel = OpVariable %_ptr_Function_v2float Function
200 %cMass = OpVariable %_ptr_Function_v2float Function
201 %cVel = OpVariable %_ptr_Function_v2float Function
202 %colVel = OpVariable %_ptr_Function_v2float Function
203 %cMassCount = OpVariable %_ptr_Function_int Function
204 %cVelCount = OpVariable %_ptr_Function_int Function
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000205 %pos_0 = OpVariable %_ptr_Function_v2float Function %99
206 %vel = OpVariable %_ptr_Function_v2float Function %99
dan sinclair1b77b6c2024-08-06 15:47:05 +0000207 %i = OpVariable %_ptr_Function_uint Function
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000208 %79 = OpCompositeExtract %uint %gl_GlobalInvocationID 0
209 OpStore %index %79
dan sinclair50260412024-08-28 19:43:27 +0000210 %82 = OpLoad %uint %index None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000211 %83 = OpUGreaterThanEqual %bool %82 %uint_5
212 OpSelectionMerge %85 None
213 OpBranchConditional %83 %86 %85
214 %86 = OpLabel
215 OpReturn
216 %85 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000217 %87 = OpLoad %uint %index None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000218 %88 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %87 %uint_0
dan sinclair50260412024-08-28 19:43:27 +0000219 %91 = OpLoad %v2float %88 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000220 OpStore %vPos %91
dan sinclair50260412024-08-28 19:43:27 +0000221 %93 = OpLoad %uint %index None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000222 %94 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %93 %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000223 %96 = OpLoad %v2float %94 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000224 OpStore %vVel %96
225 OpStore %cMass %99
226 OpStore %cVel %99
227 OpStore %colVel %99
dan sinclair1b77b6c2024-08-06 15:47:05 +0000228 OpStore %cMassCount %int_0
229 OpStore %cVelCount %int_0
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000230 OpBranch %109
231 %109 = OpLabel
dan sinclair1b77b6c2024-08-06 15:47:05 +0000232 OpStore %i %uint_0
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000233 OpBranch %112
234 %112 = OpLabel
235 OpLoopMerge %113 %111 None
236 OpBranch %110
237 %110 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000238 %115 = OpLoad %uint %i None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000239 %116 = OpULessThan %bool %115 %uint_5
240 OpSelectionMerge %117 None
241 OpBranchConditional %116 %117 %118
dan sinclair1b77b6c2024-08-06 15:47:05 +0000242 %118 = OpLabel
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000243 OpBranch %113
244 %117 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000245 %119 = OpLoad %uint %i None
246 %120 = OpLoad %uint %index None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000247 %121 = OpIEqual %bool %119 %120
248 OpSelectionMerge %122 None
249 OpBranchConditional %121 %123 %122
250 %123 = OpLabel
251 OpBranch %111
252 %122 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000253 %124 = OpLoad %uint %i None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000254 %125 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %124 %uint_0
dan sinclair50260412024-08-28 19:43:27 +0000255 %126 = OpLoad %v2float %125 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000256 %127 = OpVectorShuffle %v2float %126 %126 0 1
dan sinclair50260412024-08-28 19:43:27 +0000257 OpStore %pos_0 %127 None
258 %128 = OpLoad %uint %i None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000259 %129 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %128 %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000260 %130 = OpLoad %v2float %129 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000261 %131 = OpVectorShuffle %v2float %130 %130 0 1
dan sinclair50260412024-08-28 19:43:27 +0000262 OpStore %vel %131 None
263 %132 = OpLoad %v2float %pos_0 None
264 %133 = OpLoad %v2float %vPos None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000265 %134 = OpExtInst %float %40 Distance %132 %133
266 %135 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000267 %137 = OpLoad %float %135 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000268 %138 = OpFOrdLessThan %bool %134 %137
269 OpSelectionMerge %139 None
270 OpBranchConditional %138 %140 %139
271 %140 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000272 %141 = OpLoad %v2float %cMass None
273 %142 = OpLoad %v2float %pos_0 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000274 %143 = OpFAdd %v2float %141 %142
dan sinclair50260412024-08-28 19:43:27 +0000275 OpStore %cMass %143 None
276 %144 = OpLoad %int %cMassCount None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000277 %145 = OpIAdd %int %144 %int_1
dan sinclair50260412024-08-28 19:43:27 +0000278 OpStore %cMassCount %145 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000279 OpBranch %139
280 %139 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000281 %147 = OpLoad %v2float %pos_0 None
282 %148 = OpLoad %v2float %vPos None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000283 %149 = OpExtInst %float %40 Distance %147 %148
284 %150 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_2
dan sinclair50260412024-08-28 19:43:27 +0000285 %152 = OpLoad %float %150 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000286 %153 = OpFOrdLessThan %bool %149 %152
287 OpSelectionMerge %154 None
288 OpBranchConditional %153 %155 %154
289 %155 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000290 %156 = OpLoad %v2float %colVel None
291 %157 = OpLoad %v2float %pos_0 None
292 %158 = OpLoad %v2float %vPos None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000293 %159 = OpFSub %v2float %157 %158
294 %160 = OpFSub %v2float %156 %159
dan sinclair50260412024-08-28 19:43:27 +0000295 OpStore %colVel %160 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000296 OpBranch %154
297 %154 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000298 %161 = OpLoad %v2float %pos_0 None
299 %162 = OpLoad %v2float %vPos None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000300 %163 = OpExtInst %float %40 Distance %161 %162
301 %164 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_3
dan sinclair50260412024-08-28 19:43:27 +0000302 %166 = OpLoad %float %164 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000303 %167 = OpFOrdLessThan %bool %163 %166
304 OpSelectionMerge %168 None
305 OpBranchConditional %167 %169 %168
306 %169 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000307 %170 = OpLoad %v2float %cVel None
308 %171 = OpLoad %v2float %vel None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000309 %172 = OpFAdd %v2float %170 %171
dan sinclair50260412024-08-28 19:43:27 +0000310 OpStore %cVel %172 None
311 %173 = OpLoad %int %cVelCount None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000312 %174 = OpIAdd %int %173 %int_1
dan sinclair50260412024-08-28 19:43:27 +0000313 OpStore %cVelCount %174 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000314 OpBranch %168
315 %168 = OpLabel
316 OpBranch %111
317 %111 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000318 %175 = OpLoad %uint %i None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000319 %176 = OpIAdd %uint %175 %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000320 OpStore %i %176 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000321 OpBranch %112
322 %113 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000323 %177 = OpLoad %int %cMassCount None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000324 %178 = OpSGreaterThan %bool %177 %int_0
325 OpSelectionMerge %179 None
326 OpBranchConditional %178 %180 %179
327 %180 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000328 %181 = OpLoad %v2float %cMass None
329 %182 = OpLoad %int %cMassCount None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000330 %183 = OpConvertSToF %float %182
dan sinclair50260412024-08-28 19:43:27 +0000331 %184 = OpLoad %int %cMassCount None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000332 %185 = OpConvertSToF %float %184
333 %186 = OpCompositeConstruct %v2float %183 %185
334 %187 = OpFDiv %v2float %181 %186
dan sinclair50260412024-08-28 19:43:27 +0000335 %188 = OpLoad %v2float %vPos None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000336 %189 = OpFSub %v2float %187 %188
dan sinclair50260412024-08-28 19:43:27 +0000337 OpStore %cMass %189 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000338 OpBranch %179
339 %179 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000340 %190 = OpLoad %int %cVelCount None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000341 %191 = OpSGreaterThan %bool %190 %int_0
342 OpSelectionMerge %192 None
343 OpBranchConditional %191 %193 %192
344 %193 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000345 %194 = OpLoad %v2float %cVel None
346 %195 = OpLoad %int %cVelCount None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000347 %196 = OpConvertSToF %float %195
dan sinclair50260412024-08-28 19:43:27 +0000348 %197 = OpLoad %int %cVelCount None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000349 %198 = OpConvertSToF %float %197
350 %199 = OpCompositeConstruct %v2float %196 %198
351 %200 = OpFDiv %v2float %194 %199
dan sinclair50260412024-08-28 19:43:27 +0000352 OpStore %cVel %200 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000353 OpBranch %192
354 %192 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000355 %201 = OpLoad %v2float %vVel None
356 %202 = OpLoad %v2float %cMass None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000357 %203 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_4
dan sinclair50260412024-08-28 19:43:27 +0000358 %205 = OpLoad %float %203 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000359 %206 = OpVectorTimesScalar %v2float %202 %205
360 %207 = OpFAdd %v2float %201 %206
dan sinclair50260412024-08-28 19:43:27 +0000361 %208 = OpLoad %v2float %colVel None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000362 %209 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_5
dan sinclair50260412024-08-28 19:43:27 +0000363 %210 = OpLoad %float %209 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000364 %211 = OpVectorTimesScalar %v2float %208 %210
365 %212 = OpFAdd %v2float %207 %211
dan sinclair50260412024-08-28 19:43:27 +0000366 %213 = OpLoad %v2float %cVel None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000367 %214 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_6
dan sinclair50260412024-08-28 19:43:27 +0000368 %216 = OpLoad %float %214 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000369 %217 = OpVectorTimesScalar %v2float %213 %216
370 %218 = OpFAdd %v2float %212 %217
dan sinclair50260412024-08-28 19:43:27 +0000371 OpStore %vVel %218 None
372 %219 = OpLoad %v2float %vVel None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000373 %220 = OpExtInst %v2float %40 Normalize %219
dan sinclair50260412024-08-28 19:43:27 +0000374 %221 = OpLoad %v2float %vVel None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000375 %222 = OpExtInst %float %40 Length %221
376 %223 = OpExtInst %float %40 NClamp %222 %float_0 %float_0_100000001
377 %225 = OpVectorTimesScalar %v2float %220 %223
dan sinclair50260412024-08-28 19:43:27 +0000378 OpStore %vVel %225 None
379 %226 = OpLoad %v2float %vPos None
380 %227 = OpLoad %v2float %vVel None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000381 %228 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_0
dan sinclair50260412024-08-28 19:43:27 +0000382 %229 = OpLoad %float %228 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000383 %230 = OpVectorTimesScalar %v2float %227 %229
384 %231 = OpFAdd %v2float %226 %230
dan sinclair50260412024-08-28 19:43:27 +0000385 OpStore %vPos %231 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000386 %232 = OpAccessChain %_ptr_Function_float %vPos %uint_0
dan sinclair50260412024-08-28 19:43:27 +0000387 %233 = OpLoad %float %232 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000388 %234 = OpFOrdLessThan %bool %233 %float_n1
389 OpSelectionMerge %236 None
390 OpBranchConditional %234 %237 %236
391 %237 = OpLabel
392 %238 = OpAccessChain %_ptr_Function_float %vPos %uint_0
dan sinclair50260412024-08-28 19:43:27 +0000393 OpStore %238 %float_1 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000394 OpBranch %236
395 %236 = OpLabel
dan sinclair1b77b6c2024-08-06 15:47:05 +0000396 %239 = OpAccessChain %_ptr_Function_float %vPos %uint_0
dan sinclair50260412024-08-28 19:43:27 +0000397 %240 = OpLoad %float %239 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000398 %241 = OpFOrdGreaterThan %bool %240 %float_1
399 OpSelectionMerge %242 None
400 OpBranchConditional %241 %243 %242
dan sinclair1b77b6c2024-08-06 15:47:05 +0000401 %243 = OpLabel
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000402 %244 = OpAccessChain %_ptr_Function_float %vPos %uint_0
dan sinclair50260412024-08-28 19:43:27 +0000403 OpStore %244 %float_n1 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000404 OpBranch %242
405 %242 = OpLabel
406 %245 = OpAccessChain %_ptr_Function_float %vPos %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000407 %246 = OpLoad %float %245 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000408 %247 = OpFOrdLessThan %bool %246 %float_n1
409 OpSelectionMerge %248 None
410 OpBranchConditional %247 %249 %248
dan sinclair1b77b6c2024-08-06 15:47:05 +0000411 %249 = OpLabel
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000412 %250 = OpAccessChain %_ptr_Function_float %vPos %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000413 OpStore %250 %float_1 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000414 OpBranch %248
415 %248 = OpLabel
416 %251 = OpAccessChain %_ptr_Function_float %vPos %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000417 %252 = OpLoad %float %251 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000418 %253 = OpFOrdGreaterThan %bool %252 %float_1
419 OpSelectionMerge %254 None
420 OpBranchConditional %253 %255 %254
dan sinclair1b77b6c2024-08-06 15:47:05 +0000421 %255 = OpLabel
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000422 %256 = OpAccessChain %_ptr_Function_float %vPos %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000423 OpStore %256 %float_n1 None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000424 OpBranch %254
425 %254 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000426 %257 = OpLoad %uint %index None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000427 %258 = OpAccessChain %_ptr_StorageBuffer_v2float %15 %uint_0 %uint_0 %257 %uint_0
dan sinclair50260412024-08-28 19:43:27 +0000428 %259 = OpLoad %v2float %vPos None
429 OpStore %258 %259 None
430 %260 = OpLoad %uint %index None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000431 %261 = OpAccessChain %_ptr_StorageBuffer_v2float %15 %uint_0 %uint_0 %260 %uint_1
dan sinclair50260412024-08-28 19:43:27 +0000432 %262 = OpLoad %v2float %vVel None
433 OpStore %261 %262 None
dan sinclair1b77b6c2024-08-06 15:47:05 +0000434 OpReturn
435 OpFunctionEnd
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000436 %vert_main = OpFunction %void None %264
437 %265 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000438 %266 = OpLoad %v2float %vert_main_loc0_Input None
439 %267 = OpLoad %v2float %vert_main_loc1_Input None
440 %268 = OpLoad %v2float %vert_main_loc2_Input None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000441 %269 = OpFunctionCall %v4float %vert_main_inner %266 %267 %268
dan sinclair50260412024-08-28 19:43:27 +0000442 OpStore %vert_main_position_Output %269 None
443 OpStore %vert_main___point_size_Output %float_1 None
dan sinclair1b77b6c2024-08-06 15:47:05 +0000444 OpReturn
445 OpFunctionEnd
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000446 %frag_main = OpFunction %void None %264
447 %271 = OpLabel
448 %272 = OpFunctionCall %v4float %frag_main_inner
dan sinclair50260412024-08-28 19:43:27 +0000449 OpStore %frag_main_loc0_Output %272 None
dan sinclair1b77b6c2024-08-06 15:47:05 +0000450 OpReturn
451 OpFunctionEnd
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000452 %comp_main = OpFunction %void None %264
453 %274 = OpLabel
dan sinclair50260412024-08-28 19:43:27 +0000454 %275 = OpLoad %v3uint %comp_main_global_invocation_id_Input None
Peter McNeeley4c92f4b2024-08-20 19:16:36 +0000455 %276 = OpFunctionCall %void %comp_main_inner %275
dan sinclair1b77b6c2024-08-06 15:47:05 +0000456 OpReturn
457 OpFunctionEnd