mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 10:03:58 +01:00
Fixes #1642. Since 1d textures cannot have mipmaps, MSL requires that the `level` argument to texel accesses and dimension queries be a constexpr 0. For our purposes, just omit the level argument altogether.
423 lines
13 KiB
Plaintext
423 lines
13 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.1
|
|
; Generator: rspirv
|
|
; Bound: 292
|
|
OpCapability SampledCubeArray
|
|
OpCapability ImageQuery
|
|
OpCapability Image1D
|
|
OpCapability Shader
|
|
OpCapability Sampled1D
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %72 "main" %69
|
|
OpEntryPoint GLCompute %117 "depth_load" %115
|
|
OpEntryPoint Vertex %138 "queries" %136
|
|
OpEntryPoint Vertex %188 "levels_queries" %187
|
|
OpEntryPoint Fragment %217 "sample" %216
|
|
OpEntryPoint Fragment %244 "sample_comparison" %242
|
|
OpEntryPoint Fragment %258 "gather" %257
|
|
OpEntryPoint Fragment %280 "depth_no_comparison" %279
|
|
OpExecutionMode %72 LocalSize 16 1 1
|
|
OpExecutionMode %117 LocalSize 16 1 1
|
|
OpExecutionMode %217 OriginUpperLeft
|
|
OpExecutionMode %244 OriginUpperLeft
|
|
OpExecutionMode %258 OriginUpperLeft
|
|
OpExecutionMode %280 OriginUpperLeft
|
|
OpSource GLSL 450
|
|
OpName %32 "image_mipmapped_src"
|
|
OpName %34 "image_multisampled_src"
|
|
OpName %36 "image_depth_multisampled_src"
|
|
OpName %38 "image_storage_src"
|
|
OpName %40 "image_array_src"
|
|
OpName %42 "image_dup_src"
|
|
OpName %44 "image_1d_src"
|
|
OpName %46 "image_dst"
|
|
OpName %48 "image_1d"
|
|
OpName %50 "image_2d"
|
|
OpName %52 "image_2d_array"
|
|
OpName %54 "image_cube"
|
|
OpName %56 "image_cube_array"
|
|
OpName %58 "image_3d"
|
|
OpName %60 "image_aa"
|
|
OpName %62 "sampler_reg"
|
|
OpName %64 "sampler_cmp"
|
|
OpName %66 "image_2d_depth"
|
|
OpName %69 "local_id"
|
|
OpName %72 "main"
|
|
OpName %115 "local_id"
|
|
OpName %117 "depth_load"
|
|
OpName %138 "queries"
|
|
OpName %188 "levels_queries"
|
|
OpName %217 "sample"
|
|
OpName %244 "sample_comparison"
|
|
OpName %258 "gather"
|
|
OpName %280 "depth_no_comparison"
|
|
OpDecorate %32 DescriptorSet 0
|
|
OpDecorate %32 Binding 0
|
|
OpDecorate %34 DescriptorSet 0
|
|
OpDecorate %34 Binding 3
|
|
OpDecorate %36 DescriptorSet 0
|
|
OpDecorate %36 Binding 4
|
|
OpDecorate %38 NonWritable
|
|
OpDecorate %38 DescriptorSet 0
|
|
OpDecorate %38 Binding 1
|
|
OpDecorate %40 DescriptorSet 0
|
|
OpDecorate %40 Binding 5
|
|
OpDecorate %42 NonWritable
|
|
OpDecorate %42 DescriptorSet 0
|
|
OpDecorate %42 Binding 6
|
|
OpDecorate %44 DescriptorSet 0
|
|
OpDecorate %44 Binding 7
|
|
OpDecorate %46 NonReadable
|
|
OpDecorate %46 DescriptorSet 0
|
|
OpDecorate %46 Binding 2
|
|
OpDecorate %48 DescriptorSet 0
|
|
OpDecorate %48 Binding 0
|
|
OpDecorate %50 DescriptorSet 0
|
|
OpDecorate %50 Binding 1
|
|
OpDecorate %52 DescriptorSet 0
|
|
OpDecorate %52 Binding 2
|
|
OpDecorate %54 DescriptorSet 0
|
|
OpDecorate %54 Binding 3
|
|
OpDecorate %56 DescriptorSet 0
|
|
OpDecorate %56 Binding 4
|
|
OpDecorate %58 DescriptorSet 0
|
|
OpDecorate %58 Binding 5
|
|
OpDecorate %60 DescriptorSet 0
|
|
OpDecorate %60 Binding 6
|
|
OpDecorate %62 DescriptorSet 1
|
|
OpDecorate %62 Binding 0
|
|
OpDecorate %64 DescriptorSet 1
|
|
OpDecorate %64 Binding 1
|
|
OpDecorate %66 DescriptorSet 1
|
|
OpDecorate %66 Binding 2
|
|
OpDecorate %69 BuiltIn LocalInvocationId
|
|
OpDecorate %115 BuiltIn LocalInvocationId
|
|
OpDecorate %136 BuiltIn Position
|
|
OpDecorate %187 BuiltIn Position
|
|
OpDecorate %216 Location 0
|
|
OpDecorate %242 Location 0
|
|
OpDecorate %257 Location 0
|
|
OpDecorate %279 Location 0
|
|
%2 = OpTypeVoid
|
|
%4 = OpTypeInt 32 1
|
|
%3 = OpConstant %4 10
|
|
%5 = OpConstant %4 20
|
|
%6 = OpConstant %4 1
|
|
%8 = OpTypeFloat 32
|
|
%7 = OpConstant %8 0.5
|
|
%9 = OpConstant %8 2.3
|
|
%10 = OpConstant %4 3
|
|
%12 = OpTypeInt 32 0
|
|
%11 = OpTypeImage %12 2D 0 0 0 1 Unknown
|
|
%13 = OpTypeImage %12 2D 0 0 1 1 Unknown
|
|
%14 = OpTypeImage %8 2D 1 0 1 1 Unknown
|
|
%15 = OpTypeImage %12 2D 0 0 0 2 Rgba8ui
|
|
%16 = OpTypeImage %12 2D 0 1 0 1 Unknown
|
|
%17 = OpTypeImage %12 1D 0 0 0 2 R32ui
|
|
%18 = OpTypeImage %12 1D 0 0 0 1 Unknown
|
|
%19 = OpTypeVector %12 3
|
|
%20 = OpTypeVector %4 2
|
|
%21 = OpTypeImage %8 1D 0 0 0 1 Unknown
|
|
%22 = OpTypeImage %8 2D 0 0 0 1 Unknown
|
|
%23 = OpTypeImage %8 2D 0 1 0 1 Unknown
|
|
%24 = OpTypeImage %8 Cube 0 0 0 1 Unknown
|
|
%25 = OpTypeImage %8 Cube 0 1 0 1 Unknown
|
|
%26 = OpTypeImage %8 3D 0 0 0 1 Unknown
|
|
%27 = OpTypeImage %8 2D 0 0 1 1 Unknown
|
|
%28 = OpTypeVector %8 4
|
|
%29 = OpTypeSampler
|
|
%30 = OpTypeImage %8 2D 1 0 0 1 Unknown
|
|
%31 = OpConstantComposite %20 %10 %6
|
|
%33 = OpTypePointer UniformConstant %11
|
|
%32 = OpVariable %33 UniformConstant
|
|
%35 = OpTypePointer UniformConstant %13
|
|
%34 = OpVariable %35 UniformConstant
|
|
%37 = OpTypePointer UniformConstant %14
|
|
%36 = OpVariable %37 UniformConstant
|
|
%39 = OpTypePointer UniformConstant %15
|
|
%38 = OpVariable %39 UniformConstant
|
|
%41 = OpTypePointer UniformConstant %16
|
|
%40 = OpVariable %41 UniformConstant
|
|
%43 = OpTypePointer UniformConstant %17
|
|
%42 = OpVariable %43 UniformConstant
|
|
%45 = OpTypePointer UniformConstant %18
|
|
%44 = OpVariable %45 UniformConstant
|
|
%47 = OpTypePointer UniformConstant %17
|
|
%46 = OpVariable %47 UniformConstant
|
|
%49 = OpTypePointer UniformConstant %21
|
|
%48 = OpVariable %49 UniformConstant
|
|
%51 = OpTypePointer UniformConstant %22
|
|
%50 = OpVariable %51 UniformConstant
|
|
%53 = OpTypePointer UniformConstant %23
|
|
%52 = OpVariable %53 UniformConstant
|
|
%55 = OpTypePointer UniformConstant %24
|
|
%54 = OpVariable %55 UniformConstant
|
|
%57 = OpTypePointer UniformConstant %25
|
|
%56 = OpVariable %57 UniformConstant
|
|
%59 = OpTypePointer UniformConstant %26
|
|
%58 = OpVariable %59 UniformConstant
|
|
%61 = OpTypePointer UniformConstant %27
|
|
%60 = OpVariable %61 UniformConstant
|
|
%63 = OpTypePointer UniformConstant %29
|
|
%62 = OpVariable %63 UniformConstant
|
|
%65 = OpTypePointer UniformConstant %29
|
|
%64 = OpVariable %65 UniformConstant
|
|
%67 = OpTypePointer UniformConstant %30
|
|
%66 = OpVariable %67 UniformConstant
|
|
%70 = OpTypePointer Input %19
|
|
%69 = OpVariable %70 Input
|
|
%73 = OpTypeFunction %2
|
|
%82 = OpTypeVector %12 2
|
|
%90 = OpTypeVector %12 4
|
|
%101 = OpTypeVector %4 3
|
|
%115 = OpVariable %70 Input
|
|
%137 = OpTypePointer Output %28
|
|
%136 = OpVariable %137 Output
|
|
%146 = OpConstant %12 0
|
|
%187 = OpVariable %137 Output
|
|
%216 = OpVariable %137 Output
|
|
%222 = OpTypeVector %8 2
|
|
%225 = OpTypeSampledImage %21
|
|
%228 = OpTypeSampledImage %22
|
|
%243 = OpTypePointer Output %8
|
|
%242 = OpVariable %243 Output
|
|
%249 = OpTypeSampledImage %30
|
|
%254 = OpConstant %8 0.0
|
|
%257 = OpVariable %137 Output
|
|
%267 = OpConstant %12 1
|
|
%270 = OpConstant %12 3
|
|
%279 = OpVariable %137 Output
|
|
%72 = OpFunction %2 None %73
|
|
%68 = OpLabel
|
|
%71 = OpLoad %19 %69
|
|
%74 = OpLoad %11 %32
|
|
%75 = OpLoad %13 %34
|
|
%76 = OpLoad %15 %38
|
|
%77 = OpLoad %16 %40
|
|
%78 = OpLoad %18 %44
|
|
%79 = OpLoad %17 %46
|
|
OpBranch %80
|
|
%80 = OpLabel
|
|
%81 = OpImageQuerySize %20 %76
|
|
%83 = OpVectorShuffle %82 %71 %71 0 1
|
|
%84 = OpBitcast %20 %83
|
|
%85 = OpIMul %20 %81 %84
|
|
%86 = OpCompositeConstruct %20 %3 %5
|
|
%87 = OpSMod %20 %85 %86
|
|
%88 = OpCompositeExtract %12 %71 2
|
|
%89 = OpBitcast %4 %88
|
|
%91 = OpImageFetch %90 %74 %87 Lod %89
|
|
%92 = OpCompositeExtract %12 %71 2
|
|
%93 = OpBitcast %4 %92
|
|
%94 = OpImageFetch %90 %75 %87 Sample %93
|
|
%95 = OpImageRead %90 %76 %87
|
|
%96 = OpCompositeExtract %12 %71 2
|
|
%97 = OpBitcast %4 %96
|
|
%98 = OpCompositeExtract %12 %71 2
|
|
%99 = OpBitcast %4 %98
|
|
%100 = OpIAdd %4 %99 %6
|
|
%102 = OpCompositeConstruct %101 %87 %97
|
|
%103 = OpImageFetch %90 %77 %102 Lod %100
|
|
%104 = OpCompositeExtract %12 %71 0
|
|
%105 = OpBitcast %4 %104
|
|
%106 = OpCompositeExtract %12 %71 2
|
|
%107 = OpBitcast %4 %106
|
|
%108 = OpImageFetch %90 %78 %105 Lod %107
|
|
%109 = OpCompositeExtract %4 %87 0
|
|
%110 = OpIAdd %90 %91 %94
|
|
%111 = OpIAdd %90 %110 %95
|
|
%112 = OpIAdd %90 %111 %103
|
|
%113 = OpIAdd %90 %112 %108
|
|
OpImageWrite %79 %109 %113
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%117 = OpFunction %2 None %73
|
|
%114 = OpLabel
|
|
%116 = OpLoad %19 %115
|
|
%118 = OpLoad %14 %36
|
|
%119 = OpLoad %15 %38
|
|
%120 = OpLoad %17 %46
|
|
OpBranch %121
|
|
%121 = OpLabel
|
|
%122 = OpImageQuerySize %20 %119
|
|
%123 = OpVectorShuffle %82 %116 %116 0 1
|
|
%124 = OpBitcast %20 %123
|
|
%125 = OpIMul %20 %122 %124
|
|
%126 = OpCompositeConstruct %20 %3 %5
|
|
%127 = OpSMod %20 %125 %126
|
|
%128 = OpCompositeExtract %12 %116 2
|
|
%129 = OpBitcast %4 %128
|
|
%130 = OpImageFetch %28 %118 %127 Sample %129
|
|
%131 = OpCompositeExtract %8 %130 0
|
|
%132 = OpCompositeExtract %4 %127 0
|
|
%133 = OpConvertFToU %12 %131
|
|
%134 = OpCompositeConstruct %90 %133 %133 %133 %133
|
|
OpImageWrite %120 %132 %134
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%138 = OpFunction %2 None %73
|
|
%135 = OpLabel
|
|
%139 = OpLoad %21 %48
|
|
%140 = OpLoad %22 %50
|
|
%141 = OpLoad %23 %52
|
|
%142 = OpLoad %24 %54
|
|
%143 = OpLoad %25 %56
|
|
%144 = OpLoad %26 %58
|
|
OpBranch %145
|
|
%145 = OpLabel
|
|
%147 = OpImageQuerySizeLod %4 %139 %146
|
|
%148 = OpBitcast %4 %147
|
|
%149 = OpImageQuerySizeLod %4 %139 %148
|
|
%150 = OpImageQuerySizeLod %20 %140 %146
|
|
%151 = OpImageQuerySizeLod %20 %140 %6
|
|
%152 = OpImageQuerySizeLod %101 %141 %146
|
|
%153 = OpVectorShuffle %20 %152 %152 0 1
|
|
%154 = OpImageQuerySizeLod %101 %141 %6
|
|
%155 = OpVectorShuffle %20 %154 %154 0 1
|
|
%156 = OpImageQuerySizeLod %20 %142 %146
|
|
%157 = OpImageQuerySizeLod %20 %142 %6
|
|
%158 = OpImageQuerySizeLod %101 %143 %146
|
|
%159 = OpVectorShuffle %20 %158 %158 0 0
|
|
%160 = OpImageQuerySizeLod %101 %143 %6
|
|
%161 = OpVectorShuffle %20 %160 %160 0 0
|
|
%162 = OpImageQuerySizeLod %101 %144 %146
|
|
%163 = OpImageQuerySizeLod %101 %144 %6
|
|
%164 = OpCompositeExtract %4 %150 1
|
|
%165 = OpIAdd %4 %147 %164
|
|
%166 = OpCompositeExtract %4 %151 1
|
|
%167 = OpIAdd %4 %165 %166
|
|
%168 = OpCompositeExtract %4 %153 1
|
|
%169 = OpIAdd %4 %167 %168
|
|
%170 = OpCompositeExtract %4 %155 1
|
|
%171 = OpIAdd %4 %169 %170
|
|
%172 = OpCompositeExtract %4 %156 1
|
|
%173 = OpIAdd %4 %171 %172
|
|
%174 = OpCompositeExtract %4 %157 1
|
|
%175 = OpIAdd %4 %173 %174
|
|
%176 = OpCompositeExtract %4 %159 1
|
|
%177 = OpIAdd %4 %175 %176
|
|
%178 = OpCompositeExtract %4 %161 1
|
|
%179 = OpIAdd %4 %177 %178
|
|
%180 = OpCompositeExtract %4 %162 2
|
|
%181 = OpIAdd %4 %179 %180
|
|
%182 = OpCompositeExtract %4 %163 2
|
|
%183 = OpIAdd %4 %181 %182
|
|
%184 = OpConvertSToF %8 %183
|
|
%185 = OpCompositeConstruct %28 %184 %184 %184 %184
|
|
OpStore %136 %185
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%188 = OpFunction %2 None %73
|
|
%186 = OpLabel
|
|
%189 = OpLoad %22 %50
|
|
%190 = OpLoad %23 %52
|
|
%191 = OpLoad %24 %54
|
|
%192 = OpLoad %25 %56
|
|
%193 = OpLoad %26 %58
|
|
%194 = OpLoad %27 %60
|
|
OpBranch %195
|
|
%195 = OpLabel
|
|
%196 = OpImageQueryLevels %4 %189
|
|
%197 = OpImageQueryLevels %4 %190
|
|
%198 = OpImageQuerySizeLod %101 %190 %146
|
|
%199 = OpCompositeExtract %4 %198 2
|
|
%200 = OpImageQueryLevels %4 %191
|
|
%201 = OpImageQueryLevels %4 %192
|
|
%202 = OpImageQuerySizeLod %101 %192 %146
|
|
%203 = OpCompositeExtract %4 %202 2
|
|
%204 = OpImageQueryLevels %4 %193
|
|
%205 = OpImageQuerySamples %4 %194
|
|
%206 = OpIAdd %4 %199 %203
|
|
%207 = OpIAdd %4 %206 %205
|
|
%208 = OpIAdd %4 %207 %196
|
|
%209 = OpIAdd %4 %208 %197
|
|
%210 = OpIAdd %4 %209 %204
|
|
%211 = OpIAdd %4 %210 %200
|
|
%212 = OpIAdd %4 %211 %201
|
|
%213 = OpConvertSToF %8 %212
|
|
%214 = OpCompositeConstruct %28 %213 %213 %213 %213
|
|
OpStore %187 %214
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%217 = OpFunction %2 None %73
|
|
%215 = OpLabel
|
|
%218 = OpLoad %21 %48
|
|
%219 = OpLoad %22 %50
|
|
%220 = OpLoad %29 %62
|
|
OpBranch %221
|
|
%221 = OpLabel
|
|
%223 = OpCompositeConstruct %222 %7 %7
|
|
%224 = OpCompositeExtract %8 %223 0
|
|
%226 = OpSampledImage %225 %218 %220
|
|
%227 = OpImageSampleImplicitLod %28 %226 %224
|
|
%229 = OpSampledImage %228 %219 %220
|
|
%230 = OpImageSampleImplicitLod %28 %229 %223
|
|
%231 = OpSampledImage %228 %219 %220
|
|
%232 = OpImageSampleImplicitLod %28 %231 %223 ConstOffset %31
|
|
%233 = OpSampledImage %228 %219 %220
|
|
%234 = OpImageSampleExplicitLod %28 %233 %223 Lod %9
|
|
%235 = OpSampledImage %228 %219 %220
|
|
%236 = OpImageSampleExplicitLod %28 %235 %223 Lod|ConstOffset %9 %31
|
|
%237 = OpFAdd %28 %227 %230
|
|
%238 = OpFAdd %28 %237 %232
|
|
%239 = OpFAdd %28 %238 %234
|
|
%240 = OpFAdd %28 %239 %236
|
|
OpStore %216 %240
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%244 = OpFunction %2 None %73
|
|
%241 = OpLabel
|
|
%245 = OpLoad %29 %64
|
|
%246 = OpLoad %30 %66
|
|
OpBranch %247
|
|
%247 = OpLabel
|
|
%248 = OpCompositeConstruct %222 %7 %7
|
|
%250 = OpSampledImage %249 %246 %245
|
|
%251 = OpImageSampleDrefImplicitLod %8 %250 %248 %7
|
|
%252 = OpSampledImage %249 %246 %245
|
|
%253 = OpImageSampleDrefExplicitLod %8 %252 %248 %7 Lod %254
|
|
%255 = OpFAdd %8 %251 %253
|
|
OpStore %242 %255
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%258 = OpFunction %2 None %73
|
|
%256 = OpLabel
|
|
%259 = OpLoad %22 %50
|
|
%260 = OpLoad %29 %62
|
|
%261 = OpLoad %29 %64
|
|
%262 = OpLoad %30 %66
|
|
OpBranch %263
|
|
%263 = OpLabel
|
|
%264 = OpCompositeConstruct %222 %7 %7
|
|
%265 = OpSampledImage %228 %259 %260
|
|
%266 = OpImageGather %28 %265 %264 %267
|
|
%268 = OpSampledImage %228 %259 %260
|
|
%269 = OpImageGather %28 %268 %264 %270 ConstOffset %31
|
|
%271 = OpSampledImage %249 %262 %261
|
|
%272 = OpImageDrefGather %28 %271 %264 %7
|
|
%273 = OpSampledImage %249 %262 %261
|
|
%274 = OpImageDrefGather %28 %273 %264 %7 ConstOffset %31
|
|
%275 = OpFAdd %28 %266 %269
|
|
%276 = OpFAdd %28 %275 %272
|
|
%277 = OpFAdd %28 %276 %274
|
|
OpStore %257 %277
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%280 = OpFunction %2 None %73
|
|
%278 = OpLabel
|
|
%281 = OpLoad %29 %62
|
|
%282 = OpLoad %30 %66
|
|
OpBranch %283
|
|
%283 = OpLabel
|
|
%284 = OpCompositeConstruct %222 %7 %7
|
|
%285 = OpSampledImage %249 %282 %281
|
|
%286 = OpImageSampleImplicitLod %28 %285 %284
|
|
%287 = OpCompositeExtract %8 %286 0
|
|
%288 = OpSampledImage %249 %282 %281
|
|
%289 = OpImageGather %28 %288 %284 %146
|
|
%290 = OpCompositeConstruct %28 %287 %287 %287 %287
|
|
%291 = OpFAdd %28 %290 %289
|
|
OpStore %279 %291
|
|
OpReturn
|
|
OpFunctionEnd |