Files
wgpu/tests/out/spv/access.spvasm
Jim Blandy 8b267218a4 Implement module compaction.
Add a new Naga feature, `"compact"`, which adds a new function
`naga::compact::compact`, which removes unused expressions, types, and
constants from a `Module`.
2023-09-20 18:46:33 +02:00

495 lines
14 KiB
Plaintext

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