wgpu/naga/tests/out/spv/boids.spvasm
2023-10-25 14:25:04 -04:00

332 lines
8.5 KiB
Plaintext

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