dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 1 | ; SPIR-V |
| 2 | ; Version: 1.3 |
| 3 | ; Generator: Google Tint Compiler; 1 |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 4 | ; Bound: 277 |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 5 | ; 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 sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 49 | 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 sinclair | d117d65 | 2024-08-21 01:20:00 +0000 | [diff] [blame] | 83 | OpDecorate %6 Coherent |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 84 | OpMemberDecorate %tint_symbol_5 0 Offset 0 |
| 85 | OpDecorate %tint_symbol_5 Block |
| 86 | OpDecorate %15 DescriptorSet 0 |
| 87 | OpDecorate %15 Binding 2 |
dan sinclair | d117d65 | 2024-08-21 01:20:00 +0000 | [diff] [blame] | 88 | OpDecorate %15 Coherent |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 89 | 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 sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 135 | %_ptr_Function_uint = OpTypePointer Function %uint |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 136 | %bool = OpTypeBool |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 137 | %_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float |
| 138 | %uint_0 = OpConstant %uint 0 |
| 139 | %uint_1 = OpConstant %uint 1 |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 140 | %99 = OpConstantNull %v2float |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 141 | %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 McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 152 | %264 = OpTypeFunction %void |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 153 | %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 sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 166 | %45 = OpLoad %float %angle None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 167 | %46 = OpExtInst %float %40 Cos %45 |
| 168 | %47 = OpFMul %float %44 %46 |
| 169 | %48 = OpCompositeExtract %float %a_pos 1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 170 | %49 = OpLoad %float %angle None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 171 | %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 sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 175 | %54 = OpLoad %float %angle None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 176 | %55 = OpExtInst %float %40 Sin %54 |
| 177 | %56 = OpFMul %float %53 %55 |
| 178 | %57 = OpCompositeExtract %float %a_pos 1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 179 | %58 = OpLoad %float %angle None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 180 | %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 sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 185 | %65 = OpLoad %v2float %pos None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 186 | %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 sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 197 | %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 McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 205 | %pos_0 = OpVariable %_ptr_Function_v2float Function %99 |
| 206 | %vel = OpVariable %_ptr_Function_v2float Function %99 |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 207 | %i = OpVariable %_ptr_Function_uint Function |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 208 | %79 = OpCompositeExtract %uint %gl_GlobalInvocationID 0 |
| 209 | OpStore %index %79 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 210 | %82 = OpLoad %uint %index None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 211 | %83 = OpUGreaterThanEqual %bool %82 %uint_5 |
| 212 | OpSelectionMerge %85 None |
| 213 | OpBranchConditional %83 %86 %85 |
| 214 | %86 = OpLabel |
| 215 | OpReturn |
| 216 | %85 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 217 | %87 = OpLoad %uint %index None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 218 | %88 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %87 %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 219 | %91 = OpLoad %v2float %88 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 220 | OpStore %vPos %91 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 221 | %93 = OpLoad %uint %index None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 222 | %94 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %93 %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 223 | %96 = OpLoad %v2float %94 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 224 | OpStore %vVel %96 |
| 225 | OpStore %cMass %99 |
| 226 | OpStore %cVel %99 |
| 227 | OpStore %colVel %99 |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 228 | OpStore %cMassCount %int_0 |
| 229 | OpStore %cVelCount %int_0 |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 230 | OpBranch %109 |
| 231 | %109 = OpLabel |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 232 | OpStore %i %uint_0 |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 233 | OpBranch %112 |
| 234 | %112 = OpLabel |
| 235 | OpLoopMerge %113 %111 None |
| 236 | OpBranch %110 |
| 237 | %110 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 238 | %115 = OpLoad %uint %i None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 239 | %116 = OpULessThan %bool %115 %uint_5 |
| 240 | OpSelectionMerge %117 None |
| 241 | OpBranchConditional %116 %117 %118 |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 242 | %118 = OpLabel |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 243 | OpBranch %113 |
| 244 | %117 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 245 | %119 = OpLoad %uint %i None |
| 246 | %120 = OpLoad %uint %index None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 247 | %121 = OpIEqual %bool %119 %120 |
| 248 | OpSelectionMerge %122 None |
| 249 | OpBranchConditional %121 %123 %122 |
| 250 | %123 = OpLabel |
| 251 | OpBranch %111 |
| 252 | %122 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 253 | %124 = OpLoad %uint %i None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 254 | %125 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %124 %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 255 | %126 = OpLoad %v2float %125 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 256 | %127 = OpVectorShuffle %v2float %126 %126 0 1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 257 | OpStore %pos_0 %127 None |
| 258 | %128 = OpLoad %uint %i None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 259 | %129 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %128 %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 260 | %130 = OpLoad %v2float %129 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 261 | %131 = OpVectorShuffle %v2float %130 %130 0 1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 262 | OpStore %vel %131 None |
| 263 | %132 = OpLoad %v2float %pos_0 None |
| 264 | %133 = OpLoad %v2float %vPos None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 265 | %134 = OpExtInst %float %40 Distance %132 %133 |
| 266 | %135 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 267 | %137 = OpLoad %float %135 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 268 | %138 = OpFOrdLessThan %bool %134 %137 |
| 269 | OpSelectionMerge %139 None |
| 270 | OpBranchConditional %138 %140 %139 |
| 271 | %140 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 272 | %141 = OpLoad %v2float %cMass None |
| 273 | %142 = OpLoad %v2float %pos_0 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 274 | %143 = OpFAdd %v2float %141 %142 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 275 | OpStore %cMass %143 None |
| 276 | %144 = OpLoad %int %cMassCount None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 277 | %145 = OpIAdd %int %144 %int_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 278 | OpStore %cMassCount %145 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 279 | OpBranch %139 |
| 280 | %139 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 281 | %147 = OpLoad %v2float %pos_0 None |
| 282 | %148 = OpLoad %v2float %vPos None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 283 | %149 = OpExtInst %float %40 Distance %147 %148 |
| 284 | %150 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_2 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 285 | %152 = OpLoad %float %150 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 286 | %153 = OpFOrdLessThan %bool %149 %152 |
| 287 | OpSelectionMerge %154 None |
| 288 | OpBranchConditional %153 %155 %154 |
| 289 | %155 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 290 | %156 = OpLoad %v2float %colVel None |
| 291 | %157 = OpLoad %v2float %pos_0 None |
| 292 | %158 = OpLoad %v2float %vPos None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 293 | %159 = OpFSub %v2float %157 %158 |
| 294 | %160 = OpFSub %v2float %156 %159 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 295 | OpStore %colVel %160 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 296 | OpBranch %154 |
| 297 | %154 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 298 | %161 = OpLoad %v2float %pos_0 None |
| 299 | %162 = OpLoad %v2float %vPos None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 300 | %163 = OpExtInst %float %40 Distance %161 %162 |
| 301 | %164 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_3 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 302 | %166 = OpLoad %float %164 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 303 | %167 = OpFOrdLessThan %bool %163 %166 |
| 304 | OpSelectionMerge %168 None |
| 305 | OpBranchConditional %167 %169 %168 |
| 306 | %169 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 307 | %170 = OpLoad %v2float %cVel None |
| 308 | %171 = OpLoad %v2float %vel None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 309 | %172 = OpFAdd %v2float %170 %171 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 310 | OpStore %cVel %172 None |
| 311 | %173 = OpLoad %int %cVelCount None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 312 | %174 = OpIAdd %int %173 %int_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 313 | OpStore %cVelCount %174 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 314 | OpBranch %168 |
| 315 | %168 = OpLabel |
| 316 | OpBranch %111 |
| 317 | %111 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 318 | %175 = OpLoad %uint %i None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 319 | %176 = OpIAdd %uint %175 %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 320 | OpStore %i %176 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 321 | OpBranch %112 |
| 322 | %113 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 323 | %177 = OpLoad %int %cMassCount None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 324 | %178 = OpSGreaterThan %bool %177 %int_0 |
| 325 | OpSelectionMerge %179 None |
| 326 | OpBranchConditional %178 %180 %179 |
| 327 | %180 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 328 | %181 = OpLoad %v2float %cMass None |
| 329 | %182 = OpLoad %int %cMassCount None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 330 | %183 = OpConvertSToF %float %182 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 331 | %184 = OpLoad %int %cMassCount None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 332 | %185 = OpConvertSToF %float %184 |
| 333 | %186 = OpCompositeConstruct %v2float %183 %185 |
| 334 | %187 = OpFDiv %v2float %181 %186 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 335 | %188 = OpLoad %v2float %vPos None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 336 | %189 = OpFSub %v2float %187 %188 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 337 | OpStore %cMass %189 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 338 | OpBranch %179 |
| 339 | %179 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 340 | %190 = OpLoad %int %cVelCount None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 341 | %191 = OpSGreaterThan %bool %190 %int_0 |
| 342 | OpSelectionMerge %192 None |
| 343 | OpBranchConditional %191 %193 %192 |
| 344 | %193 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 345 | %194 = OpLoad %v2float %cVel None |
| 346 | %195 = OpLoad %int %cVelCount None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 347 | %196 = OpConvertSToF %float %195 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 348 | %197 = OpLoad %int %cVelCount None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 349 | %198 = OpConvertSToF %float %197 |
| 350 | %199 = OpCompositeConstruct %v2float %196 %198 |
| 351 | %200 = OpFDiv %v2float %194 %199 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 352 | OpStore %cVel %200 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 353 | OpBranch %192 |
| 354 | %192 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 355 | %201 = OpLoad %v2float %vVel None |
| 356 | %202 = OpLoad %v2float %cMass None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 357 | %203 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_4 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 358 | %205 = OpLoad %float %203 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 359 | %206 = OpVectorTimesScalar %v2float %202 %205 |
| 360 | %207 = OpFAdd %v2float %201 %206 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 361 | %208 = OpLoad %v2float %colVel None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 362 | %209 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_5 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 363 | %210 = OpLoad %float %209 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 364 | %211 = OpVectorTimesScalar %v2float %208 %210 |
| 365 | %212 = OpFAdd %v2float %207 %211 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 366 | %213 = OpLoad %v2float %cVel None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 367 | %214 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_6 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 368 | %216 = OpLoad %float %214 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 369 | %217 = OpVectorTimesScalar %v2float %213 %216 |
| 370 | %218 = OpFAdd %v2float %212 %217 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 371 | OpStore %vVel %218 None |
| 372 | %219 = OpLoad %v2float %vVel None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 373 | %220 = OpExtInst %v2float %40 Normalize %219 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 374 | %221 = OpLoad %v2float %vVel None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 375 | %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 sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 378 | OpStore %vVel %225 None |
| 379 | %226 = OpLoad %v2float %vPos None |
| 380 | %227 = OpLoad %v2float %vVel None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 381 | %228 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 382 | %229 = OpLoad %float %228 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 383 | %230 = OpVectorTimesScalar %v2float %227 %229 |
| 384 | %231 = OpFAdd %v2float %226 %230 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 385 | OpStore %vPos %231 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 386 | %232 = OpAccessChain %_ptr_Function_float %vPos %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 387 | %233 = OpLoad %float %232 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 388 | %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 sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 393 | OpStore %238 %float_1 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 394 | OpBranch %236 |
| 395 | %236 = OpLabel |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 396 | %239 = OpAccessChain %_ptr_Function_float %vPos %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 397 | %240 = OpLoad %float %239 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 398 | %241 = OpFOrdGreaterThan %bool %240 %float_1 |
| 399 | OpSelectionMerge %242 None |
| 400 | OpBranchConditional %241 %243 %242 |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 401 | %243 = OpLabel |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 402 | %244 = OpAccessChain %_ptr_Function_float %vPos %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 403 | OpStore %244 %float_n1 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 404 | OpBranch %242 |
| 405 | %242 = OpLabel |
| 406 | %245 = OpAccessChain %_ptr_Function_float %vPos %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 407 | %246 = OpLoad %float %245 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 408 | %247 = OpFOrdLessThan %bool %246 %float_n1 |
| 409 | OpSelectionMerge %248 None |
| 410 | OpBranchConditional %247 %249 %248 |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 411 | %249 = OpLabel |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 412 | %250 = OpAccessChain %_ptr_Function_float %vPos %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 413 | OpStore %250 %float_1 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 414 | OpBranch %248 |
| 415 | %248 = OpLabel |
| 416 | %251 = OpAccessChain %_ptr_Function_float %vPos %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 417 | %252 = OpLoad %float %251 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 418 | %253 = OpFOrdGreaterThan %bool %252 %float_1 |
| 419 | OpSelectionMerge %254 None |
| 420 | OpBranchConditional %253 %255 %254 |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 421 | %255 = OpLabel |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 422 | %256 = OpAccessChain %_ptr_Function_float %vPos %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 423 | OpStore %256 %float_n1 None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 424 | OpBranch %254 |
| 425 | %254 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 426 | %257 = OpLoad %uint %index None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 427 | %258 = OpAccessChain %_ptr_StorageBuffer_v2float %15 %uint_0 %uint_0 %257 %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 428 | %259 = OpLoad %v2float %vPos None |
| 429 | OpStore %258 %259 None |
| 430 | %260 = OpLoad %uint %index None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 431 | %261 = OpAccessChain %_ptr_StorageBuffer_v2float %15 %uint_0 %uint_0 %260 %uint_1 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 432 | %262 = OpLoad %v2float %vVel None |
| 433 | OpStore %261 %262 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 434 | OpReturn |
| 435 | OpFunctionEnd |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 436 | %vert_main = OpFunction %void None %264 |
| 437 | %265 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 438 | %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 McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 441 | %269 = OpFunctionCall %v4float %vert_main_inner %266 %267 %268 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 442 | OpStore %vert_main_position_Output %269 None |
| 443 | OpStore %vert_main___point_size_Output %float_1 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 444 | OpReturn |
| 445 | OpFunctionEnd |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 446 | %frag_main = OpFunction %void None %264 |
| 447 | %271 = OpLabel |
| 448 | %272 = OpFunctionCall %v4float %frag_main_inner |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 449 | OpStore %frag_main_loc0_Output %272 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 450 | OpReturn |
| 451 | OpFunctionEnd |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 452 | %comp_main = OpFunction %void None %264 |
| 453 | %274 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 454 | %275 = OpLoad %v3uint %comp_main_global_invocation_id_Input None |
Peter McNeeley | 4c92f4b | 2024-08-20 19:16:36 +0000 | [diff] [blame] | 455 | %276 = OpFunctionCall %void %comp_main_inner %275 |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 456 | OpReturn |
| 457 | OpFunctionEnd |