Files
wgpu/tests/out/spv/boids.spvasm
T

339 lines
8.6 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: rspirv
; Bound: 209
OpCapability Shader
OpExtension "SPV_KHR_storage_buffer_storage_class"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %39 "main" %36
OpExecutionMode %39 LocalSize 64 1 1
OpMemberName %6 0 "pos"
OpMemberName %6 1 "vel"
OpName %6 "Particle"
OpMemberName %7 0 "deltaT"
OpMemberName %7 1 "rule1Distance"
OpMemberName %7 2 "rule2Distance"
OpMemberName %7 3 "rule3Distance"
OpMemberName %7 4 "rule1Scale"
OpMemberName %7 5 "rule2Scale"
OpMemberName %7 6 "rule3Scale"
OpName %7 "SimParams"
OpMemberName %9 0 "particles"
OpName %9 "Particles"
OpName %12 "NUM_PARTICLES"
OpName %13 "params"
OpName %16 "particlesSrc"
OpName %18 "particlesDst"
OpName %19 "vPos"
OpName %22 "vVel"
OpName %23 "cMass"
OpName %24 "cVel"
OpName %25 "colVel"
OpName %26 "cMassCount"
OpName %29 "cVelCount"
OpName %30 "pos"
OpName %31 "vel"
OpName %32 "i"
OpName %36 "global_invocation_id"
OpName %39 "main"
OpMemberDecorate %6 0 Offset 0
OpMemberDecorate %6 1 Offset 8
OpMemberDecorate %7 0 Offset 0
OpMemberDecorate %7 1 Offset 4
OpMemberDecorate %7 2 Offset 8
OpMemberDecorate %7 3 Offset 12
OpMemberDecorate %7 4 Offset 16
OpMemberDecorate %7 5 Offset 20
OpMemberDecorate %7 6 Offset 24
OpDecorate %8 ArrayStride 16
OpMemberDecorate %9 0 Offset 0
OpDecorate %9 Block
OpDecorate %13 DescriptorSet 0
OpDecorate %13 Binding 0
OpDecorate %14 Block
OpMemberDecorate %14 0 Offset 0
OpDecorate %16 NonWritable
OpDecorate %16 DescriptorSet 0
OpDecorate %16 Binding 1
OpDecorate %18 DescriptorSet 0
OpDecorate %18 Binding 2
OpDecorate %36 BuiltIn GlobalInvocationId
%2 = OpTypeVoid
%3 = OpTypeInt 32 0
%5 = OpTypeFloat 32
%4 = OpTypeVector %5 2
%6 = OpTypeStruct %4 %4
%7 = OpTypeStruct %5 %5 %5 %5 %5 %5 %5
%8 = OpTypeRuntimeArray %6
%9 = OpTypeStruct %8
%10 = OpTypeVector %3 3
%11 = OpTypeInt 32 1
%12 = OpConstant %3 1500
%14 = OpTypeStruct %7
%15 = OpTypePointer Uniform %14
%13 = OpVariable %15 Uniform
%17 = OpTypePointer StorageBuffer %9
%16 = OpVariable %17 StorageBuffer
%18 = OpVariable %17 StorageBuffer
%20 = OpTypePointer Function %4
%21 = OpConstantNull %4
%27 = OpTypePointer Function %11
%28 = OpConstantNull %11
%33 = OpTypePointer Function %3
%34 = OpConstantNull %3
%37 = OpTypePointer Input %10
%36 = OpVariable %37 Input
%40 = OpTypeFunction %2
%41 = OpTypePointer Uniform %7
%42 = OpConstant %3 0
%44 = OpConstant %5 0.0
%45 = OpConstant %11 0
%46 = OpConstant %11 1
%47 = OpConstant %3 1
%48 = OpConstant %5 0.1
%49 = OpConstant %5 -1.0
%50 = OpConstant %5 1.0
%53 = OpTypeBool
%57 = OpTypePointer StorageBuffer %8
%58 = OpTypePointer StorageBuffer %6
%59 = OpTypePointer StorageBuffer %4
%88 = OpTypePointer Uniform %5
%102 = OpConstant %3 2
%116 = OpConstant %3 3
%151 = OpConstant %3 4
%157 = OpConstant %3 5
%163 = OpConstant %3 6
%180 = OpTypePointer Function %5
%39 = OpFunction %2 None %40
%35 = OpLabel
%32 = OpVariable %33 Function %34
%29 = OpVariable %27 Function %28
%24 = OpVariable %20 Function %21
%19 = OpVariable %20 Function %21
%30 = OpVariable %20 Function %21
%25 = OpVariable %20 Function %21
%22 = OpVariable %20 Function %21
%31 = OpVariable %20 Function %21
%26 = OpVariable %27 Function %28
%23 = OpVariable %20 Function %21
%38 = OpLoad %10 %36
%43 = OpAccessChain %41 %13 %42
OpBranch %51
%51 = OpLabel
%52 = OpCompositeExtract %3 %38 0
%54 = OpUGreaterThanEqual %53 %52 %12
OpSelectionMerge %55 None
OpBranchConditional %54 %56 %55
%56 = OpLabel
OpReturn
%55 = OpLabel
%60 = OpAccessChain %59 %16 %42 %52 %42
%61 = OpLoad %4 %60
OpStore %19 %61
%62 = OpAccessChain %59 %16 %42 %52 %47
%63 = OpLoad %4 %62
OpStore %22 %63
%64 = OpCompositeConstruct %4 %44 %44
OpStore %23 %64
%65 = OpCompositeConstruct %4 %44 %44
OpStore %24 %65
%66 = OpCompositeConstruct %4 %44 %44
OpStore %25 %66
OpStore %26 %45
OpStore %29 %45
OpStore %32 %42
OpBranch %67
%67 = OpLabel
OpLoopMerge %68 %70 None
OpBranch %69
%69 = OpLabel
%71 = OpLoad %3 %32
%72 = OpUGreaterThanEqual %53 %71 %12
OpSelectionMerge %73 None
OpBranchConditional %72 %74 %73
%74 = OpLabel
OpBranch %68
%73 = OpLabel
%75 = OpLoad %3 %32
%76 = OpIEqual %53 %75 %52
OpSelectionMerge %77 None
OpBranchConditional %76 %78 %77
%78 = OpLabel
OpBranch %70
%77 = OpLabel
%79 = OpLoad %3 %32
%80 = OpAccessChain %59 %16 %42 %79 %42
%81 = OpLoad %4 %80
OpStore %30 %81
%82 = OpLoad %3 %32
%83 = OpAccessChain %59 %16 %42 %82 %47
%84 = OpLoad %4 %83
OpStore %31 %84
%85 = OpLoad %4 %30
%86 = OpLoad %4 %19
%87 = OpExtInst %5 %1 Distance %85 %86
%89 = OpAccessChain %88 %43 %47
%90 = OpLoad %5 %89
%91 = OpFOrdLessThan %53 %87 %90
OpSelectionMerge %92 None
OpBranchConditional %91 %93 %92
%93 = OpLabel
%94 = OpLoad %4 %23
%95 = OpLoad %4 %30
%96 = OpFAdd %4 %94 %95
OpStore %23 %96
%97 = OpLoad %11 %26
%98 = OpIAdd %11 %97 %46
OpStore %26 %98
OpBranch %92
%92 = OpLabel
%99 = OpLoad %4 %30
%100 = OpLoad %4 %19
%101 = OpExtInst %5 %1 Distance %99 %100
%103 = OpAccessChain %88 %43 %102
%104 = OpLoad %5 %103
%105 = OpFOrdLessThan %53 %101 %104
OpSelectionMerge %106 None
OpBranchConditional %105 %107 %106
%107 = OpLabel
%108 = OpLoad %4 %25
%109 = OpLoad %4 %30
%110 = OpLoad %4 %19
%111 = OpFSub %4 %109 %110
%112 = OpFSub %4 %108 %111
OpStore %25 %112
OpBranch %106
%106 = OpLabel
%113 = OpLoad %4 %30
%114 = OpLoad %4 %19
%115 = OpExtInst %5 %1 Distance %113 %114
%117 = OpAccessChain %88 %43 %116
%118 = OpLoad %5 %117
%119 = OpFOrdLessThan %53 %115 %118
OpSelectionMerge %120 None
OpBranchConditional %119 %121 %120
%121 = OpLabel
%122 = OpLoad %4 %24
%123 = OpLoad %4 %31
%124 = OpFAdd %4 %122 %123
OpStore %24 %124
%125 = OpLoad %11 %29
%126 = OpIAdd %11 %125 %46
OpStore %29 %126
OpBranch %120
%120 = OpLabel
OpBranch %70
%70 = OpLabel
%127 = OpLoad %3 %32
%128 = OpIAdd %3 %127 %47
OpStore %32 %128
OpBranch %67
%68 = OpLabel
%129 = OpLoad %11 %26
%130 = OpSGreaterThan %53 %129 %45
OpSelectionMerge %131 None
OpBranchConditional %130 %132 %131
%132 = OpLabel
%133 = OpLoad %4 %23
%134 = OpLoad %11 %26
%135 = OpConvertSToF %5 %134
%136 = OpCompositeConstruct %4 %135 %135
%137 = OpFDiv %4 %133 %136
%138 = OpLoad %4 %19
%139 = OpFSub %4 %137 %138
OpStore %23 %139
OpBranch %131
%131 = OpLabel
%140 = OpLoad %11 %29
%141 = OpSGreaterThan %53 %140 %45
OpSelectionMerge %142 None
OpBranchConditional %141 %143 %142
%143 = OpLabel
%144 = OpLoad %4 %24
%145 = OpLoad %11 %29
%146 = OpConvertSToF %5 %145
%147 = OpCompositeConstruct %4 %146 %146
%148 = OpFDiv %4 %144 %147
OpStore %24 %148
OpBranch %142
%142 = OpLabel
%149 = OpLoad %4 %22
%150 = OpLoad %4 %23
%152 = OpAccessChain %88 %43 %151
%153 = OpLoad %5 %152
%154 = OpVectorTimesScalar %4 %150 %153
%155 = OpFAdd %4 %149 %154
%156 = OpLoad %4 %25
%158 = OpAccessChain %88 %43 %157
%159 = OpLoad %5 %158
%160 = OpVectorTimesScalar %4 %156 %159
%161 = OpFAdd %4 %155 %160
%162 = OpLoad %4 %24
%164 = OpAccessChain %88 %43 %163
%165 = OpLoad %5 %164
%166 = OpVectorTimesScalar %4 %162 %165
%167 = OpFAdd %4 %161 %166
OpStore %22 %167
%168 = OpLoad %4 %22
%169 = OpExtInst %4 %1 Normalize %168
%170 = OpLoad %4 %22
%171 = OpExtInst %5 %1 Length %170
%172 = OpExtInst %5 %1 FClamp %171 %44 %48
%173 = OpVectorTimesScalar %4 %169 %172
OpStore %22 %173
%174 = OpLoad %4 %19
%175 = OpLoad %4 %22
%176 = OpAccessChain %88 %43 %42
%177 = OpLoad %5 %176
%178 = OpVectorTimesScalar %4 %175 %177
%179 = OpFAdd %4 %174 %178
OpStore %19 %179
%181 = OpAccessChain %180 %19 %42
%182 = OpLoad %5 %181
%183 = OpFOrdLessThan %53 %182 %49
OpSelectionMerge %184 None
OpBranchConditional %183 %185 %184
%185 = OpLabel
%186 = OpAccessChain %180 %19 %42
OpStore %186 %50
OpBranch %184
%184 = OpLabel
%187 = OpAccessChain %180 %19 %42
%188 = OpLoad %5 %187
%189 = OpFOrdGreaterThan %53 %188 %50
OpSelectionMerge %190 None
OpBranchConditional %189 %191 %190
%191 = OpLabel
%192 = OpAccessChain %180 %19 %42
OpStore %192 %49
OpBranch %190
%190 = OpLabel
%193 = OpAccessChain %180 %19 %47
%194 = OpLoad %5 %193
%195 = OpFOrdLessThan %53 %194 %49
OpSelectionMerge %196 None
OpBranchConditional %195 %197 %196
%197 = OpLabel
%198 = OpAccessChain %180 %19 %47
OpStore %198 %50
OpBranch %196
%196 = OpLabel
%199 = OpAccessChain %180 %19 %47
%200 = OpLoad %5 %199
%201 = OpFOrdGreaterThan %53 %200 %50
OpSelectionMerge %202 None
OpBranchConditional %201 %203 %202
%203 = OpLabel
%204 = OpAccessChain %180 %19 %47
OpStore %204 %49
OpBranch %202
%202 = OpLabel
%205 = OpLoad %4 %19
%206 = OpAccessChain %59 %18 %42 %52 %42
OpStore %206 %205
%207 = OpLoad %4 %22
%208 = OpAccessChain %59 %18 %42 %52 %47
OpStore %208 %207
OpReturn
OpFunctionEnd