Files
wgpu/tests/out/spv/access.spvasm
T
Teodor Tanasoaia 9742f1616c fix zero initialization of workgroup memory (#2259)
Use the local (not global) invocation id to decide which invocation should do the initialization, so that every workgroup gets initialized, not just the first.
2023-02-20 19:56:24 -08:00

544 lines
15 KiB
Plaintext

; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 354
OpCapability Shader
OpExtension "SPV_KHR_storage_buffer_storage_class"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %247 "foo_vert" %242 %245
OpEntryPoint Fragment %289 "foo_frag" %288
OpEntryPoint GLCompute %308 "atomics"
OpEntryPoint GLCompute %334 "assign_through_ptr" %337
OpExecutionMode %289 OriginUpperLeft
OpExecutionMode %308 LocalSize 1 1 1
OpExecutionMode %334 LocalSize 1 1 1
OpSource GLSL 450
OpMemberName %36 0 "a"
OpMemberName %36 1 "b"
OpMemberName %36 2 "c"
OpName %36 "GlobalConst"
OpMemberName %37 0 "value"
OpName %37 "AlignedWrapper"
OpMemberName %47 0 "_matrix"
OpMemberName %47 1 "matrix_array"
OpMemberName %47 2 "atom"
OpMemberName %47 3 "atom_arr"
OpMemberName %47 4 "arr"
OpMemberName %47 5 "data"
OpName %47 "Bar"
OpMemberName %49 0 "m"
OpName %49 "Baz"
OpMemberName %53 0 "am"
OpName %53 "MatCx2InArray"
OpName %72 "global_const"
OpName %74 "bar"
OpName %76 "baz"
OpName %79 "qux"
OpName %82 "nested_mat_cx2"
OpName %85 "val"
OpName %86 "idx"
OpName %89 "t"
OpName %93 "test_matrix_within_struct_accesses"
OpName %150 "idx"
OpName %152 "t"
OpName %156 "test_matrix_within_array_within_struct_accesses"
OpName %211 "foo"
OpName %212 "read_from_private"
OpName %217 "a"
OpName %218 "test_arr_as_arg"
OpName %224 "p"
OpName %225 "assign_through_ptr_fn"
OpName %229 "foo"
OpName %230 "assign_array_through_ptr_fn"
OpName %236 "foo"
OpName %238 "c2"
OpName %242 "vi"
OpName %247 "foo_vert"
OpName %289 "foo_frag"
OpName %305 "tmp"
OpName %308 "atomics"
OpName %331 "arr"
OpName %334 "assign_through_ptr"
OpMemberDecorate %36 0 Offset 0
OpMemberDecorate %36 1 Offset 16
OpMemberDecorate %36 2 Offset 28
OpMemberDecorate %37 0 Offset 0
OpDecorate %42 ArrayStride 16
OpDecorate %43 ArrayStride 4
OpDecorate %45 ArrayStride 8
OpDecorate %46 ArrayStride 8
OpMemberDecorate %47 0 Offset 0
OpMemberDecorate %47 0 ColMajor
OpMemberDecorate %47 0 MatrixStride 16
OpMemberDecorate %47 1 Offset 64
OpMemberDecorate %47 1 ColMajor
OpMemberDecorate %47 1 MatrixStride 8
OpMemberDecorate %47 2 Offset 96
OpMemberDecorate %47 3 Offset 100
OpMemberDecorate %47 4 Offset 144
OpMemberDecorate %47 5 Offset 160
OpMemberDecorate %49 0 Offset 0
OpMemberDecorate %49 0 ColMajor
OpMemberDecorate %49 0 MatrixStride 8
OpDecorate %52 ArrayStride 32
OpMemberDecorate %53 0 Offset 0
OpMemberDecorate %53 0 ColMajor
OpMemberDecorate %53 0 MatrixStride 8
OpDecorate %55 ArrayStride 4
OpDecorate %56 ArrayStride 40
OpDecorate %59 ArrayStride 4
OpDecorate %62 ArrayStride 16
OpDecorate %74 DescriptorSet 0
OpDecorate %74 Binding 0
OpDecorate %47 Block
OpDecorate %76 DescriptorSet 0
OpDecorate %76 Binding 1
OpDecorate %77 Block
OpMemberDecorate %77 0 Offset 0
OpDecorate %79 DescriptorSet 0
OpDecorate %79 Binding 2
OpDecorate %80 Block
OpMemberDecorate %80 0 Offset 0
OpDecorate %82 DescriptorSet 0
OpDecorate %82 Binding 3
OpDecorate %83 Block
OpMemberDecorate %83 0 Offset 0
OpDecorate %242 BuiltIn VertexIndex
OpDecorate %245 BuiltIn Position
OpDecorate %288 Location 0
OpDecorate %337 BuiltIn LocalInvocationId
%2 = OpTypeVoid
%4 = OpTypeInt 32 0
%3 = OpConstant %4 0
%6 = OpTypeInt 32 1
%5 = OpConstant %6 0
%7 = OpConstant %6 2
%8 = OpConstant %6 10
%9 = OpConstant %6 1
%11 = OpTypeFloat 32
%10 = OpConstant %11 1.0
%12 = OpConstant %11 2.0
%13 = OpConstant %11 3.0
%14 = OpConstant %11 6.0
%15 = OpConstant %11 5.0
%16 = OpConstant %11 4.0
%17 = OpConstant %11 9.0
%18 = OpConstant %11 90.0
%19 = OpConstant %11 10.0
%20 = OpConstant %11 20.0
%21 = OpConstant %11 30.0
%22 = OpConstant %11 40.0
%23 = OpConstant %11 0.0
%24 = OpConstant %11 8.0
%25 = OpConstant %11 7.0
%26 = OpConstant %6 5
%27 = OpConstant %6 4
%28 = OpConstant %6 9
%29 = OpConstant %4 3
%30 = OpConstant %4 2
%31 = OpConstant %6 3
%32 = OpConstant %4 1
%33 = OpConstant %6 42
%34 = OpConstant %4 42
%35 = OpTypeVector %4 3
%36 = OpTypeStruct %4 %35 %6
%37 = OpTypeStruct %6
%39 = OpTypeVector %11 3
%38 = OpTypeMatrix %39 4
%41 = OpTypeVector %11 2
%40 = OpTypeMatrix %41 2
%42 = OpTypeArray %40 %7
%43 = OpTypeArray %6 %8
%44 = OpTypeVector %4 2
%45 = OpTypeArray %44 %7
%46 = OpTypeRuntimeArray %37
%47 = OpTypeStruct %38 %42 %6 %43 %45 %46
%48 = OpTypeMatrix %41 3
%49 = OpTypeStruct %48
%50 = OpTypeVector %6 2
%51 = OpTypeMatrix %41 4
%52 = OpTypeArray %51 %7
%53 = OpTypeStruct %52
%54 = OpTypePointer Function %11
%55 = OpTypeArray %11 %8
%56 = OpTypeArray %55 %26
%57 = OpTypeVector %11 4
%58 = OpTypePointer StorageBuffer %6
%59 = OpTypeArray %6 %26
%60 = OpTypeVector %6 4
%61 = OpTypePointer Workgroup %4
%62 = OpTypeArray %57 %7
%63 = OpTypePointer Function %62
%64 = OpConstantComposite %35 %3 %3 %3
%65 = OpConstantComposite %36 %3 %64 %5
%66 = OpConstantComposite %41 %23 %23
%67 = OpConstantComposite %51 %66 %66 %66 %66
%68 = OpConstantComposite %52 %67 %67
%69 = OpConstantComposite %55 %23 %23 %23 %23 %23 %23 %23 %23 %23 %23
%70 = OpConstantComposite %56 %69 %69 %69 %69 %69
%71 = OpConstantComposite %50 %5 %5
%73 = OpTypePointer Private %36
%72 = OpVariable %73 Private %65
%75 = OpTypePointer StorageBuffer %47
%74 = OpVariable %75 StorageBuffer
%77 = OpTypeStruct %49
%78 = OpTypePointer Uniform %77
%76 = OpVariable %78 Uniform
%80 = OpTypeStruct %50
%81 = OpTypePointer StorageBuffer %80
%79 = OpVariable %81 StorageBuffer
%83 = OpTypeStruct %53
%84 = OpTypePointer Uniform %83
%82 = OpVariable %84 Uniform
%85 = OpVariable %61 Workgroup
%87 = OpTypePointer Function %6
%88 = OpConstantNull %6
%90 = OpTypePointer Function %49
%91 = OpConstantNull %49
%94 = OpTypeFunction %2
%95 = OpTypePointer Uniform %49
%100 = OpTypePointer Uniform %48
%103 = OpTypePointer Uniform %41
%109 = OpTypePointer Uniform %11
%129 = OpTypePointer Function %48
%135 = OpTypePointer Function %41
%141 = OpTypePointer Function %11
%151 = OpConstantNull %6
%153 = OpTypePointer Function %53
%154 = OpConstantNull %53
%157 = OpTypePointer Uniform %53
%162 = OpTypePointer Uniform %52
%165 = OpTypePointer Uniform %51
%188 = OpTypePointer Function %52
%190 = OpTypePointer Function %51
%213 = OpTypeFunction %11 %54
%219 = OpTypeFunction %11 %56
%226 = OpTypeFunction %2 %61
%231 = OpTypeFunction %2 %63
%237 = OpConstantNull %11
%239 = OpTypePointer Function %59
%240 = OpConstantNull %59
%243 = OpTypePointer Input %4
%242 = OpVariable %243 Input
%246 = OpTypePointer Output %57
%245 = OpVariable %246 Output
%249 = OpTypePointer StorageBuffer %50
%256 = OpTypePointer StorageBuffer %38
%259 = OpTypePointer StorageBuffer %45
%260 = OpConstant %4 4
%263 = OpTypePointer StorageBuffer %39
%264 = OpTypePointer StorageBuffer %11
%267 = OpTypePointer StorageBuffer %46
%270 = OpTypePointer StorageBuffer %37
%271 = OpConstant %4 5
%288 = OpVariable %246 Output
%306 = OpConstantNull %6
%310 = OpTypePointer StorageBuffer %6
%313 = OpConstant %4 64
%332 = OpConstantNull %62
%336 = OpConstantNull %4
%338 = OpTypePointer Input %35
%337 = OpVariable %338 Input
%340 = OpConstantNull %35
%342 = OpTypeBool
%341 = OpTypeVector %342 3
%347 = OpConstant %4 264
%93 = OpFunction %2 None %94
%92 = OpLabel
%86 = OpVariable %87 Function %88
%89 = OpVariable %90 Function %91
%96 = OpAccessChain %95 %76 %3
OpBranch %97
%97 = OpLabel
OpStore %86 %9
%98 = OpLoad %6 %86
%99 = OpISub %6 %98 %9
OpStore %86 %99
%101 = OpAccessChain %100 %96 %3
%102 = OpLoad %48 %101
%104 = OpAccessChain %103 %96 %3 %3
%105 = OpLoad %41 %104
%106 = OpLoad %6 %86
%107 = OpAccessChain %103 %96 %3 %106
%108 = OpLoad %41 %107
%110 = OpAccessChain %109 %96 %3 %3 %32
%111 = OpLoad %11 %110
%112 = OpLoad %6 %86
%113 = OpAccessChain %109 %96 %3 %3 %112
%114 = OpLoad %11 %113
%115 = OpLoad %6 %86
%116 = OpAccessChain %109 %96 %3 %115 %32
%117 = OpLoad %11 %116
%118 = OpLoad %6 %86
%119 = OpLoad %6 %86
%120 = OpAccessChain %109 %96 %3 %118 %119
%121 = OpLoad %11 %120
%122 = OpCompositeConstruct %41 %10 %10
%123 = OpCompositeConstruct %41 %12 %12
%124 = OpCompositeConstruct %41 %13 %13
%125 = OpCompositeConstruct %48 %122 %123 %124
%126 = OpCompositeConstruct %49 %125
OpStore %89 %126
%127 = OpLoad %6 %86
%128 = OpIAdd %6 %127 %9
OpStore %86 %128
%130 = OpCompositeConstruct %41 %14 %14
%131 = OpCompositeConstruct %41 %15 %15
%132 = OpCompositeConstruct %41 %16 %16
%133 = OpCompositeConstruct %48 %130 %131 %132
%134 = OpAccessChain %129 %89 %3
OpStore %134 %133
%136 = OpCompositeConstruct %41 %17 %17
%137 = OpAccessChain %135 %89 %3 %3
OpStore %137 %136
%138 = OpLoad %6 %86
%139 = OpCompositeConstruct %41 %18 %18
%140 = OpAccessChain %135 %89 %3 %138
OpStore %140 %139
%142 = OpAccessChain %141 %89 %3 %3 %32
OpStore %142 %19
%143 = OpLoad %6 %86
%144 = OpAccessChain %141 %89 %3 %3 %143
OpStore %144 %20
%145 = OpLoad %6 %86
%146 = OpAccessChain %141 %89 %3 %145 %32
OpStore %146 %21
%147 = OpLoad %6 %86
%148 = OpLoad %6 %86
%149 = OpAccessChain %141 %89 %3 %147 %148
OpStore %149 %22
OpReturn
OpFunctionEnd
%156 = OpFunction %2 None %94
%155 = OpLabel
%150 = OpVariable %87 Function %151
%152 = OpVariable %153 Function %154
%158 = OpAccessChain %157 %82 %3
OpBranch %159
%159 = OpLabel
OpStore %150 %9
%160 = OpLoad %6 %150
%161 = OpISub %6 %160 %9
OpStore %150 %161
%163 = OpAccessChain %162 %158 %3
%164 = OpLoad %52 %163
%166 = OpAccessChain %165 %158 %3 %3
%167 = OpLoad %51 %166
%168 = OpAccessChain %103 %158 %3 %3 %3
%169 = OpLoad %41 %168
%170 = OpLoad %6 %150
%171 = OpAccessChain %103 %158 %3 %3 %170
%172 = OpLoad %41 %171
%173 = OpAccessChain %109 %158 %3 %3 %3 %32
%174 = OpLoad %11 %173
%175 = OpLoad %6 %150
%176 = OpAccessChain %109 %158 %3 %3 %3 %175
%177 = OpLoad %11 %176
%178 = OpLoad %6 %150
%179 = OpAccessChain %109 %158 %3 %3 %178 %32
%180 = OpLoad %11 %179
%181 = OpLoad %6 %150
%182 = OpLoad %6 %150
%183 = OpAccessChain %109 %158 %3 %3 %181 %182
%184 = OpLoad %11 %183
%185 = OpCompositeConstruct %53 %68
OpStore %152 %185
%186 = OpLoad %6 %150
%187 = OpIAdd %6 %186 %9
OpStore %150 %187
%189 = OpAccessChain %188 %152 %3
OpStore %189 %68
%191 = OpCompositeConstruct %41 %24 %24
%192 = OpCompositeConstruct %41 %25 %25
%193 = OpCompositeConstruct %41 %14 %14
%194 = OpCompositeConstruct %41 %15 %15
%195 = OpCompositeConstruct %51 %191 %192 %193 %194
%196 = OpAccessChain %190 %152 %3 %3
OpStore %196 %195
%197 = OpCompositeConstruct %41 %17 %17
%198 = OpAccessChain %135 %152 %3 %3 %3
OpStore %198 %197
%199 = OpLoad %6 %150
%200 = OpCompositeConstruct %41 %18 %18
%201 = OpAccessChain %135 %152 %3 %3 %199
OpStore %201 %200
%202 = OpAccessChain %141 %152 %3 %3 %3 %32
OpStore %202 %19
%203 = OpLoad %6 %150
%204 = OpAccessChain %141 %152 %3 %3 %3 %203
OpStore %204 %20
%205 = OpLoad %6 %150
%206 = OpAccessChain %141 %152 %3 %3 %205 %32
OpStore %206 %21
%207 = OpLoad %6 %150
%208 = OpLoad %6 %150
%209 = OpAccessChain %141 %152 %3 %3 %207 %208
OpStore %209 %22
OpReturn
OpFunctionEnd
%212 = OpFunction %11 None %213
%211 = OpFunctionParameter %54
%210 = OpLabel
OpBranch %214
%214 = OpLabel
%215 = OpLoad %11 %211
OpReturnValue %215
OpFunctionEnd
%218 = OpFunction %11 None %219
%217 = OpFunctionParameter %56
%216 = OpLabel
OpBranch %220
%220 = OpLabel
%221 = OpCompositeExtract %55 %217 4
%222 = OpCompositeExtract %11 %221 9
OpReturnValue %222
OpFunctionEnd
%225 = OpFunction %2 None %226
%224 = OpFunctionParameter %61
%223 = OpLabel
OpBranch %227
%227 = OpLabel
OpStore %224 %34
OpReturn
OpFunctionEnd
%230 = OpFunction %2 None %231
%229 = OpFunctionParameter %63
%228 = OpLabel
OpBranch %232
%232 = OpLabel
%233 = OpCompositeConstruct %57 %10 %10 %10 %10
%234 = OpCompositeConstruct %57 %12 %12 %12 %12
%235 = OpCompositeConstruct %62 %233 %234
OpStore %229 %235
OpReturn
OpFunctionEnd
%247 = OpFunction %2 None %94
%241 = OpLabel
%236 = OpVariable %54 Function %237
%238 = OpVariable %239 Function %240
%244 = OpLoad %4 %242
%248 = OpAccessChain %95 %76 %3
%250 = OpAccessChain %249 %79 %3
%251 = OpAccessChain %157 %82 %3
OpBranch %252
%252 = OpLabel
OpStore %236 %23
%253 = OpLoad %11 %236
OpStore %236 %10
%254 = OpFunctionCall %2 %93
%255 = OpFunctionCall %2 %156
%257 = OpAccessChain %256 %74 %3
%258 = OpLoad %38 %257
%261 = OpAccessChain %259 %74 %260
%262 = OpLoad %45 %261
%265 = OpAccessChain %264 %74 %3 %29 %3
%266 = OpLoad %11 %265
%268 = OpArrayLength %4 %74 5
%269 = OpISub %4 %268 %30
%272 = OpAccessChain %58 %74 %271 %269 %3
%273 = OpLoad %6 %272
%274 = OpLoad %50 %250
%275 = OpFunctionCall %11 %212 %236
%276 = OpConvertFToS %6 %266
%277 = OpCompositeConstruct %59 %273 %276 %31 %27 %26
OpStore %238 %277
%278 = OpIAdd %4 %244 %32
%279 = OpAccessChain %87 %238 %278
OpStore %279 %33
%280 = OpAccessChain %87 %238 %244
%281 = OpLoad %6 %280
%282 = OpFunctionCall %11 %218 %70
%283 = OpCompositeConstruct %60 %281 %281 %281 %281
%284 = OpConvertSToF %57 %283
%285 = OpMatrixTimesVector %39 %258 %284
%286 = OpCompositeConstruct %57 %285 %12
OpStore %245 %286
OpReturn
OpFunctionEnd
%289 = OpFunction %2 None %94
%287 = OpLabel
%290 = OpAccessChain %249 %79 %3
OpBranch %291
%291 = OpLabel
%292 = OpAccessChain %264 %74 %3 %32 %30
OpStore %292 %10
%293 = OpCompositeConstruct %39 %23 %23 %23
%294 = OpCompositeConstruct %39 %10 %10 %10
%295 = OpCompositeConstruct %39 %12 %12 %12
%296 = OpCompositeConstruct %39 %13 %13 %13
%297 = OpCompositeConstruct %38 %293 %294 %295 %296
%298 = OpAccessChain %256 %74 %3
OpStore %298 %297
%299 = OpCompositeConstruct %44 %3 %3
%300 = OpCompositeConstruct %44 %32 %32
%301 = OpCompositeConstruct %45 %299 %300
%302 = OpAccessChain %259 %74 %260
OpStore %302 %301
%303 = OpAccessChain %58 %74 %271 %32 %3
OpStore %303 %9
OpStore %290 %71
%304 = OpCompositeConstruct %57 %23 %23 %23 %23
OpStore %288 %304
OpReturn
OpFunctionEnd
%308 = OpFunction %2 None %94
%307 = OpLabel
%305 = OpVariable %87 Function %306
OpBranch %309
%309 = OpLabel
%311 = OpAccessChain %310 %74 %30
%312 = OpAtomicLoad %6 %311 %9 %313
%315 = OpAccessChain %310 %74 %30
%314 = OpAtomicIAdd %6 %315 %9 %313 %26
OpStore %305 %314
%317 = OpAccessChain %310 %74 %30
%316 = OpAtomicISub %6 %317 %9 %313 %26
OpStore %305 %316
%319 = OpAccessChain %310 %74 %30
%318 = OpAtomicAnd %6 %319 %9 %313 %26
OpStore %305 %318
%321 = OpAccessChain %310 %74 %30
%320 = OpAtomicOr %6 %321 %9 %313 %26
OpStore %305 %320
%323 = OpAccessChain %310 %74 %30
%322 = OpAtomicXor %6 %323 %9 %313 %26
OpStore %305 %322
%325 = OpAccessChain %310 %74 %30
%324 = OpAtomicSMin %6 %325 %9 %313 %26
OpStore %305 %324
%327 = OpAccessChain %310 %74 %30
%326 = OpAtomicSMax %6 %327 %9 %313 %26
OpStore %305 %326
%329 = OpAccessChain %310 %74 %30
%328 = OpAtomicExchange %6 %329 %9 %313 %26
OpStore %305 %328
%330 = OpAccessChain %310 %74 %30
OpAtomicStore %330 %9 %313 %312
OpReturn
OpFunctionEnd
%334 = OpFunction %2 None %94
%333 = OpLabel
%331 = OpVariable %63 Function %332
OpBranch %335
%335 = OpLabel
%339 = OpLoad %35 %337
%343 = OpIEqual %341 %339 %340
%344 = OpAll %342 %343
OpSelectionMerge %345 None
OpBranchConditional %344 %346 %345
%346 = OpLabel
OpStore %85 %336
OpBranch %345
%345 = OpLabel
OpControlBarrier %30 %30 %347
OpBranch %348
%348 = OpLabel
%349 = OpCompositeConstruct %57 %14 %14 %14 %14
%350 = OpCompositeConstruct %57 %25 %25 %25 %25
%351 = OpCompositeConstruct %62 %349 %350
OpStore %331 %351
%352 = OpFunctionCall %2 %225 %85
%353 = OpFunctionCall %2 %230 %331
OpReturn
OpFunctionEnd