Files
wgpu/tests/out/spv/shadow.spvasm
T
hatoo 7f4c01784c Remove vs_bake entry point from tests/in/shadow.wgsl
This entry point isn't useful for testing.
2022-03-11 20:14:25 -08:00

415 lines
12 KiB
Plaintext

; SPIR-V
; Version: 1.2
; Generator: rspirv
; Bound: 261
OpCapability Shader
OpExtension "SPV_KHR_storage_buffer_storage_class"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %93 "vs_main" %83 %86 %88 %90 %92
OpEntryPoint Fragment %147 "fs_main" %138 %141 %144 %146
OpEntryPoint Fragment %211 "fs_main_without_storage" %204 %206 %208 %210
OpExecutionMode %147 OriginUpperLeft
OpExecutionMode %211 OriginUpperLeft
OpSource GLSL 450
OpName %11 "c_max_lights"
OpMemberName %18 0 "view_proj"
OpMemberName %18 1 "num_lights"
OpName %18 "Globals"
OpMemberName %19 0 "world"
OpMemberName %19 1 "color"
OpName %19 "Entity"
OpMemberName %21 0 "proj_position"
OpMemberName %21 1 "world_normal"
OpMemberName %21 2 "world_position"
OpName %21 "VertexOutput"
OpMemberName %24 0 "proj"
OpMemberName %24 1 "pos"
OpMemberName %24 2 "color"
OpName %24 "Light"
OpName %30 "c_ambient"
OpName %31 "u_globals"
OpName %34 "u_entity"
OpName %37 "s_lights"
OpName %40 "u_lights"
OpName %43 "t_shadow"
OpName %45 "sampler_shadow"
OpName %48 "light_id"
OpName %49 "homogeneous_coords"
OpName %50 "fetch_shadow"
OpName %80 "out"
OpName %83 "position"
OpName %86 "normal"
OpName %88 "proj_position"
OpName %90 "world_normal"
OpName %92 "world_position"
OpName %93 "vs_main"
OpName %133 "color"
OpName %134 "i"
OpName %138 "proj_position"
OpName %141 "world_normal"
OpName %144 "world_position"
OpName %147 "fs_main"
OpName %200 "color"
OpName %201 "i"
OpName %204 "proj_position"
OpName %206 "world_normal"
OpName %208 "world_position"
OpName %211 "fs_main_without_storage"
OpMemberDecorate %18 0 Offset 0
OpMemberDecorate %18 0 ColMajor
OpMemberDecorate %18 0 MatrixStride 16
OpMemberDecorate %18 1 Offset 64
OpMemberDecorate %19 0 Offset 0
OpMemberDecorate %19 0 ColMajor
OpMemberDecorate %19 0 MatrixStride 16
OpMemberDecorate %19 1 Offset 64
OpMemberDecorate %21 0 Offset 0
OpMemberDecorate %21 1 Offset 16
OpMemberDecorate %21 2 Offset 32
OpMemberDecorate %24 0 Offset 0
OpMemberDecorate %24 0 ColMajor
OpMemberDecorate %24 0 MatrixStride 16
OpMemberDecorate %24 1 Offset 64
OpMemberDecorate %24 2 Offset 80
OpDecorate %25 ArrayStride 96
OpDecorate %26 ArrayStride 96
OpDecorate %31 DescriptorSet 0
OpDecorate %31 Binding 0
OpDecorate %32 Block
OpMemberDecorate %32 0 Offset 0
OpDecorate %34 DescriptorSet 1
OpDecorate %34 Binding 0
OpDecorate %35 Block
OpMemberDecorate %35 0 Offset 0
OpDecorate %37 NonWritable
OpDecorate %37 DescriptorSet 0
OpDecorate %37 Binding 1
OpDecorate %38 Block
OpMemberDecorate %38 0 Offset 0
OpDecorate %40 DescriptorSet 0
OpDecorate %40 Binding 1
OpDecorate %41 Block
OpMemberDecorate %41 0 Offset 0
OpDecorate %43 DescriptorSet 0
OpDecorate %43 Binding 2
OpDecorate %45 DescriptorSet 0
OpDecorate %45 Binding 3
OpDecorate %83 Location 0
OpDecorate %83 Flat
OpDecorate %86 Location 1
OpDecorate %86 Flat
OpDecorate %88 BuiltIn Position
OpDecorate %90 Location 0
OpDecorate %92 Location 1
OpDecorate %138 BuiltIn FragCoord
OpDecorate %141 Location 0
OpDecorate %144 Location 1
OpDecorate %146 Location 0
OpDecorate %204 BuiltIn FragCoord
OpDecorate %206 Location 0
OpDecorate %208 Location 1
OpDecorate %210 Location 0
%2 = OpTypeVoid
%4 = OpTypeInt 32 1
%3 = OpConstant %4 10
%6 = OpTypeFloat 32
%5 = OpConstant %6 0.0
%7 = OpConstant %6 1.0
%8 = OpConstant %6 0.5
%9 = OpConstant %6 -0.5
%10 = OpConstant %6 0.05
%12 = OpTypeInt 32 0
%11 = OpConstant %12 10
%13 = OpConstant %12 0
%14 = OpConstant %12 1
%16 = OpTypeVector %6 4
%15 = OpTypeMatrix %16 4
%17 = OpTypeVector %12 4
%18 = OpTypeStruct %15 %17
%19 = OpTypeStruct %15 %16
%20 = OpTypeVector %6 3
%21 = OpTypeStruct %16 %20 %16
%22 = OpTypeVector %4 4
%23 = OpTypeMatrix %20 3
%24 = OpTypeStruct %15 %16 %16
%25 = OpTypeRuntimeArray %24
%26 = OpTypeArray %24 %3
%27 = OpTypeImage %6 2D 1 1 0 1 Unknown
%28 = OpTypeSampler
%29 = OpTypeVector %6 2
%30 = OpConstantComposite %20 %10 %10 %10
%32 = OpTypeStruct %18
%33 = OpTypePointer Uniform %32
%31 = OpVariable %33 Uniform
%35 = OpTypeStruct %19
%36 = OpTypePointer Uniform %35
%34 = OpVariable %36 Uniform
%38 = OpTypeStruct %25
%39 = OpTypePointer StorageBuffer %38
%37 = OpVariable %39 StorageBuffer
%41 = OpTypeStruct %26
%42 = OpTypePointer Uniform %41
%40 = OpVariable %42 Uniform
%44 = OpTypePointer UniformConstant %27
%43 = OpVariable %44 UniformConstant
%46 = OpTypePointer UniformConstant %28
%45 = OpVariable %46 UniformConstant
%51 = OpTypeFunction %6 %12 %16
%54 = OpTypePointer Uniform %19
%55 = OpTypePointer Uniform %18
%56 = OpTypePointer Uniform %26
%57 = OpTypePointer StorageBuffer %25
%60 = OpTypeBool
%75 = OpTypeSampledImage %27
%81 = OpTypePointer Function %21
%84 = OpTypePointer Input %22
%83 = OpVariable %84 Input
%86 = OpVariable %84 Input
%89 = OpTypePointer Output %16
%88 = OpVariable %89 Output
%91 = OpTypePointer Output %20
%90 = OpVariable %91 Output
%92 = OpVariable %89 Output
%94 = OpTypeFunction %2
%98 = OpTypePointer Uniform %15
%105 = OpTypePointer Function %20
%113 = OpTypeVector %4 3
%118 = OpTypePointer Function %16
%119 = OpConstant %12 2
%127 = OpTypePointer Output %6
%135 = OpTypePointer Function %12
%139 = OpTypePointer Input %16
%138 = OpVariable %139 Input
%142 = OpTypePointer Input %20
%141 = OpVariable %142 Input
%144 = OpVariable %139 Input
%146 = OpVariable %89 Output
%161 = OpTypePointer Uniform %17
%162 = OpTypePointer Uniform %12
%170 = OpTypePointer StorageBuffer %24
%196 = OpTypePointer Uniform %16
%204 = OpVariable %139 Input
%206 = OpVariable %142 Input
%208 = OpVariable %139 Input
%210 = OpVariable %89 Output
%232 = OpTypePointer Uniform %24
%50 = OpFunction %6 None %51
%48 = OpFunctionParameter %12
%49 = OpFunctionParameter %16
%47 = OpLabel
%52 = OpLoad %27 %43
%53 = OpLoad %28 %45
OpBranch %58
%58 = OpLabel
%59 = OpCompositeExtract %6 %49 3
%61 = OpFOrdLessThanEqual %60 %59 %5
OpSelectionMerge %62 None
OpBranchConditional %61 %63 %62
%63 = OpLabel
OpReturnValue %7
%62 = OpLabel
%64 = OpCompositeConstruct %29 %8 %9
%65 = OpCompositeExtract %6 %49 3
%66 = OpFDiv %6 %7 %65
%67 = OpVectorShuffle %29 %49 %49 0 1
%68 = OpFMul %29 %67 %64
%69 = OpVectorTimesScalar %29 %68 %66
%70 = OpCompositeConstruct %29 %8 %8
%71 = OpFAdd %29 %69 %70
%72 = OpBitcast %4 %48
%73 = OpCompositeExtract %6 %49 2
%74 = OpFMul %6 %73 %66
%76 = OpConvertUToF %6 %72
%77 = OpCompositeConstruct %20 %71 %76
%78 = OpSampledImage %75 %52 %53
%79 = OpImageSampleDrefExplicitLod %6 %78 %77 %74 Lod %5
OpReturnValue %79
OpFunctionEnd
%93 = OpFunction %2 None %94
%82 = OpLabel
%80 = OpVariable %81 Function
%85 = OpLoad %22 %83
%87 = OpLoad %22 %86
%95 = OpAccessChain %55 %31 %13
%96 = OpAccessChain %54 %34 %13
OpBranch %97
%97 = OpLabel
%99 = OpAccessChain %98 %96 %13
%100 = OpLoad %15 %99
%101 = OpAccessChain %98 %96 %13
%102 = OpLoad %15 %101
%103 = OpConvertSToF %16 %85
%104 = OpMatrixTimesVector %16 %102 %103
%106 = OpCompositeExtract %16 %100 0
%107 = OpVectorShuffle %20 %106 %106 0 1 2
%108 = OpCompositeExtract %16 %100 1
%109 = OpVectorShuffle %20 %108 %108 0 1 2
%110 = OpCompositeExtract %16 %100 2
%111 = OpVectorShuffle %20 %110 %110 0 1 2
%112 = OpCompositeConstruct %23 %107 %109 %111
%114 = OpVectorShuffle %113 %87 %87 0 1 2
%115 = OpConvertSToF %20 %114
%116 = OpMatrixTimesVector %20 %112 %115
%117 = OpAccessChain %105 %80 %14
OpStore %117 %116
%120 = OpAccessChain %118 %80 %119
OpStore %120 %104
%121 = OpAccessChain %98 %95 %13
%122 = OpLoad %15 %121
%123 = OpMatrixTimesVector %16 %122 %104
%124 = OpAccessChain %118 %80 %13
OpStore %124 %123
%125 = OpLoad %21 %80
%126 = OpCompositeExtract %16 %125 0
OpStore %88 %126
%128 = OpAccessChain %127 %88 %14
%129 = OpLoad %6 %128
%130 = OpFNegate %6 %129
OpStore %128 %130
%131 = OpCompositeExtract %20 %125 1
OpStore %90 %131
%132 = OpCompositeExtract %16 %125 2
OpStore %92 %132
OpReturn
OpFunctionEnd
%147 = OpFunction %2 None %94
%136 = OpLabel
%133 = OpVariable %105 Function %30
%134 = OpVariable %135 Function %13
%140 = OpLoad %16 %138
%143 = OpLoad %20 %141
%145 = OpLoad %16 %144
%137 = OpCompositeConstruct %21 %140 %143 %145
%148 = OpAccessChain %55 %31 %13
%149 = OpAccessChain %54 %34 %13
%150 = OpAccessChain %57 %37 %13
%151 = OpLoad %27 %43
%152 = OpLoad %28 %45
OpBranch %153
%153 = OpLabel
%154 = OpCompositeExtract %20 %137 1
%155 = OpExtInst %20 %1 Normalize %154
OpBranch %156
%156 = OpLabel
OpLoopMerge %157 %159 None
OpBranch %158
%158 = OpLabel
%160 = OpLoad %12 %134
%163 = OpAccessChain %162 %148 %14 %13
%164 = OpLoad %12 %163
%165 = OpExtInst %12 %1 UMin %164 %11
%166 = OpULessThan %60 %160 %165
OpSelectionMerge %167 None
OpBranchConditional %166 %167 %168
%168 = OpLabel
OpBranch %157
%167 = OpLabel
%169 = OpLoad %12 %134
%171 = OpAccessChain %170 %150 %169
%172 = OpLoad %24 %171
%173 = OpLoad %12 %134
%174 = OpCompositeExtract %15 %172 0
%175 = OpCompositeExtract %16 %137 2
%176 = OpMatrixTimesVector %16 %174 %175
%177 = OpFunctionCall %6 %50 %173 %176
%178 = OpCompositeExtract %16 %172 1
%179 = OpVectorShuffle %20 %178 %178 0 1 2
%180 = OpCompositeExtract %16 %137 2
%181 = OpVectorShuffle %20 %180 %180 0 1 2
%182 = OpFSub %20 %179 %181
%183 = OpExtInst %20 %1 Normalize %182
%184 = OpDot %6 %155 %183
%185 = OpExtInst %6 %1 FMax %5 %184
%186 = OpLoad %20 %133
%187 = OpFMul %6 %177 %185
%188 = OpCompositeExtract %16 %172 2
%189 = OpVectorShuffle %20 %188 %188 0 1 2
%190 = OpVectorTimesScalar %20 %189 %187
%191 = OpFAdd %20 %186 %190
OpStore %133 %191
OpBranch %159
%159 = OpLabel
%192 = OpLoad %12 %134
%193 = OpIAdd %12 %192 %14
OpStore %134 %193
OpBranch %156
%157 = OpLabel
%194 = OpLoad %20 %133
%195 = OpCompositeConstruct %16 %194 %7
%197 = OpAccessChain %196 %149 %14
%198 = OpLoad %16 %197
%199 = OpFMul %16 %195 %198
OpStore %146 %199
OpReturn
OpFunctionEnd
%211 = OpFunction %2 None %94
%202 = OpLabel
%200 = OpVariable %105 Function %30
%201 = OpVariable %135 Function %13
%205 = OpLoad %16 %204
%207 = OpLoad %20 %206
%209 = OpLoad %16 %208
%203 = OpCompositeConstruct %21 %205 %207 %209
%212 = OpAccessChain %55 %31 %13
%213 = OpAccessChain %54 %34 %13
%214 = OpAccessChain %56 %40 %13
%215 = OpLoad %27 %43
%216 = OpLoad %28 %45
OpBranch %217
%217 = OpLabel
%218 = OpCompositeExtract %20 %203 1
%219 = OpExtInst %20 %1 Normalize %218
OpBranch %220
%220 = OpLabel
OpLoopMerge %221 %223 None
OpBranch %222
%222 = OpLabel
%224 = OpLoad %12 %201
%225 = OpAccessChain %162 %212 %14 %13
%226 = OpLoad %12 %225
%227 = OpExtInst %12 %1 UMin %226 %11
%228 = OpULessThan %60 %224 %227
OpSelectionMerge %229 None
OpBranchConditional %228 %229 %230
%230 = OpLabel
OpBranch %221
%229 = OpLabel
%231 = OpLoad %12 %201
%233 = OpAccessChain %232 %214 %231
%234 = OpLoad %24 %233
%235 = OpLoad %12 %201
%236 = OpCompositeExtract %15 %234 0
%237 = OpCompositeExtract %16 %203 2
%238 = OpMatrixTimesVector %16 %236 %237
%239 = OpFunctionCall %6 %50 %235 %238
%240 = OpCompositeExtract %16 %234 1
%241 = OpVectorShuffle %20 %240 %240 0 1 2
%242 = OpCompositeExtract %16 %203 2
%243 = OpVectorShuffle %20 %242 %242 0 1 2
%244 = OpFSub %20 %241 %243
%245 = OpExtInst %20 %1 Normalize %244
%246 = OpDot %6 %219 %245
%247 = OpExtInst %6 %1 FMax %5 %246
%248 = OpLoad %20 %200
%249 = OpFMul %6 %239 %247
%250 = OpCompositeExtract %16 %234 2
%251 = OpVectorShuffle %20 %250 %250 0 1 2
%252 = OpVectorTimesScalar %20 %251 %249
%253 = OpFAdd %20 %248 %252
OpStore %200 %253
OpBranch %223
%223 = OpLabel
%254 = OpLoad %12 %201
%255 = OpIAdd %12 %254 %14
OpStore %201 %255
OpBranch %220
%221 = OpLabel
%256 = OpLoad %20 %200
%257 = OpCompositeConstruct %16 %256 %7
%258 = OpAccessChain %196 %213 %14
%259 = OpLoad %16 %258
%260 = OpFMul %16 %257 %259
OpStore %210 %260
OpReturn
OpFunctionEnd