Files
wgpu/tests/out/spv/shadow.spvasm
T

416 lines
12 KiB
Plaintext

; SPIR-V
; Version: 1.2
; Generator: rspirv
; Bound: 262
OpCapability Shader
OpExtension "SPV_KHR_storage_buffer_storage_class"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %94 "vs_main" %84 %87 %89 %91 %93
OpEntryPoint Fragment %148 "fs_main" %139 %142 %145 %147
OpEntryPoint Fragment %212 "fs_main_without_storage" %205 %207 %209 %211
OpExecutionMode %148 OriginUpperLeft
OpExecutionMode %212 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 %84 "position"
OpName %87 "normal"
OpName %89 "proj_position"
OpName %91 "world_normal"
OpName %93 "world_position"
OpName %94 "vs_main"
OpName %134 "color"
OpName %135 "i"
OpName %139 "proj_position"
OpName %142 "world_normal"
OpName %145 "world_position"
OpName %148 "fs_main"
OpName %201 "color"
OpName %202 "i"
OpName %205 "proj_position"
OpName %207 "world_normal"
OpName %209 "world_position"
OpName %212 "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 %84 Location 0
OpDecorate %84 Flat
OpDecorate %87 Location 1
OpDecorate %87 Flat
OpDecorate %89 BuiltIn Position
OpDecorate %91 Location 0
OpDecorate %93 Location 1
OpDecorate %139 BuiltIn FragCoord
OpDecorate %142 Location 0
OpDecorate %145 Location 1
OpDecorate %147 Location 0
OpDecorate %205 BuiltIn FragCoord
OpDecorate %207 Location 0
OpDecorate %209 Location 1
OpDecorate %211 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
%82 = OpConstantNull %21
%85 = OpTypePointer Input %22
%84 = OpVariable %85 Input
%87 = OpVariable %85 Input
%90 = OpTypePointer Output %16
%89 = OpVariable %90 Output
%92 = OpTypePointer Output %20
%91 = OpVariable %92 Output
%93 = OpVariable %90 Output
%95 = OpTypeFunction %2
%99 = OpTypePointer Uniform %15
%106 = OpTypePointer Function %20
%114 = OpTypeVector %4 3
%119 = OpTypePointer Function %16
%120 = OpConstant %12 2
%128 = OpTypePointer Output %6
%136 = OpTypePointer Function %12
%140 = OpTypePointer Input %16
%139 = OpVariable %140 Input
%143 = OpTypePointer Input %20
%142 = OpVariable %143 Input
%145 = OpVariable %140 Input
%147 = OpVariable %90 Output
%162 = OpTypePointer Uniform %17
%163 = OpTypePointer Uniform %12
%171 = OpTypePointer StorageBuffer %24
%197 = OpTypePointer Uniform %16
%205 = OpVariable %140 Input
%207 = OpVariable %143 Input
%209 = OpVariable %140 Input
%211 = OpVariable %90 Output
%233 = 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
%94 = OpFunction %2 None %95
%83 = OpLabel
%80 = OpVariable %81 Function %82
%86 = OpLoad %22 %84
%88 = OpLoad %22 %87
%96 = OpAccessChain %55 %31 %13
%97 = OpAccessChain %54 %34 %13
OpBranch %98
%98 = OpLabel
%100 = OpAccessChain %99 %97 %13
%101 = OpLoad %15 %100
%102 = OpAccessChain %99 %97 %13
%103 = OpLoad %15 %102
%104 = OpConvertSToF %16 %86
%105 = OpMatrixTimesVector %16 %103 %104
%107 = OpCompositeExtract %16 %101 0
%108 = OpVectorShuffle %20 %107 %107 0 1 2
%109 = OpCompositeExtract %16 %101 1
%110 = OpVectorShuffle %20 %109 %109 0 1 2
%111 = OpCompositeExtract %16 %101 2
%112 = OpVectorShuffle %20 %111 %111 0 1 2
%113 = OpCompositeConstruct %23 %108 %110 %112
%115 = OpVectorShuffle %114 %88 %88 0 1 2
%116 = OpConvertSToF %20 %115
%117 = OpMatrixTimesVector %20 %113 %116
%118 = OpAccessChain %106 %80 %14
OpStore %118 %117
%121 = OpAccessChain %119 %80 %120
OpStore %121 %105
%122 = OpAccessChain %99 %96 %13
%123 = OpLoad %15 %122
%124 = OpMatrixTimesVector %16 %123 %105
%125 = OpAccessChain %119 %80 %13
OpStore %125 %124
%126 = OpLoad %21 %80
%127 = OpCompositeExtract %16 %126 0
OpStore %89 %127
%129 = OpAccessChain %128 %89 %14
%130 = OpLoad %6 %129
%131 = OpFNegate %6 %130
OpStore %129 %131
%132 = OpCompositeExtract %20 %126 1
OpStore %91 %132
%133 = OpCompositeExtract %16 %126 2
OpStore %93 %133
OpReturn
OpFunctionEnd
%148 = OpFunction %2 None %95
%137 = OpLabel
%134 = OpVariable %106 Function %30
%135 = OpVariable %136 Function %13
%141 = OpLoad %16 %139
%144 = OpLoad %20 %142
%146 = OpLoad %16 %145
%138 = OpCompositeConstruct %21 %141 %144 %146
%149 = OpAccessChain %55 %31 %13
%150 = OpAccessChain %54 %34 %13
%151 = OpAccessChain %57 %37 %13
%152 = OpLoad %27 %43
%153 = OpLoad %28 %45
OpBranch %154
%154 = OpLabel
%155 = OpCompositeExtract %20 %138 1
%156 = OpExtInst %20 %1 Normalize %155
OpBranch %157
%157 = OpLabel
OpLoopMerge %158 %160 None
OpBranch %159
%159 = OpLabel
%161 = OpLoad %12 %135
%164 = OpAccessChain %163 %149 %14 %13
%165 = OpLoad %12 %164
%166 = OpExtInst %12 %1 UMin %165 %11
%167 = OpULessThan %60 %161 %166
OpSelectionMerge %168 None
OpBranchConditional %167 %168 %169
%169 = OpLabel
OpBranch %158
%168 = OpLabel
%170 = OpLoad %12 %135
%172 = OpAccessChain %171 %151 %170
%173 = OpLoad %24 %172
%174 = OpLoad %12 %135
%175 = OpCompositeExtract %15 %173 0
%176 = OpCompositeExtract %16 %138 2
%177 = OpMatrixTimesVector %16 %175 %176
%178 = OpFunctionCall %6 %50 %174 %177
%179 = OpCompositeExtract %16 %173 1
%180 = OpVectorShuffle %20 %179 %179 0 1 2
%181 = OpCompositeExtract %16 %138 2
%182 = OpVectorShuffle %20 %181 %181 0 1 2
%183 = OpFSub %20 %180 %182
%184 = OpExtInst %20 %1 Normalize %183
%185 = OpDot %6 %156 %184
%186 = OpExtInst %6 %1 FMax %5 %185
%187 = OpLoad %20 %134
%188 = OpFMul %6 %178 %186
%189 = OpCompositeExtract %16 %173 2
%190 = OpVectorShuffle %20 %189 %189 0 1 2
%191 = OpVectorTimesScalar %20 %190 %188
%192 = OpFAdd %20 %187 %191
OpStore %134 %192
OpBranch %160
%160 = OpLabel
%193 = OpLoad %12 %135
%194 = OpIAdd %12 %193 %14
OpStore %135 %194
OpBranch %157
%158 = OpLabel
%195 = OpLoad %20 %134
%196 = OpCompositeConstruct %16 %195 %7
%198 = OpAccessChain %197 %150 %14
%199 = OpLoad %16 %198
%200 = OpFMul %16 %196 %199
OpStore %147 %200
OpReturn
OpFunctionEnd
%212 = OpFunction %2 None %95
%203 = OpLabel
%201 = OpVariable %106 Function %30
%202 = OpVariable %136 Function %13
%206 = OpLoad %16 %205
%208 = OpLoad %20 %207
%210 = OpLoad %16 %209
%204 = OpCompositeConstruct %21 %206 %208 %210
%213 = OpAccessChain %55 %31 %13
%214 = OpAccessChain %54 %34 %13
%215 = OpAccessChain %56 %40 %13
%216 = OpLoad %27 %43
%217 = OpLoad %28 %45
OpBranch %218
%218 = OpLabel
%219 = OpCompositeExtract %20 %204 1
%220 = OpExtInst %20 %1 Normalize %219
OpBranch %221
%221 = OpLabel
OpLoopMerge %222 %224 None
OpBranch %223
%223 = OpLabel
%225 = OpLoad %12 %202
%226 = OpAccessChain %163 %213 %14 %13
%227 = OpLoad %12 %226
%228 = OpExtInst %12 %1 UMin %227 %11
%229 = OpULessThan %60 %225 %228
OpSelectionMerge %230 None
OpBranchConditional %229 %230 %231
%231 = OpLabel
OpBranch %222
%230 = OpLabel
%232 = OpLoad %12 %202
%234 = OpAccessChain %233 %215 %232
%235 = OpLoad %24 %234
%236 = OpLoad %12 %202
%237 = OpCompositeExtract %15 %235 0
%238 = OpCompositeExtract %16 %204 2
%239 = OpMatrixTimesVector %16 %237 %238
%240 = OpFunctionCall %6 %50 %236 %239
%241 = OpCompositeExtract %16 %235 1
%242 = OpVectorShuffle %20 %241 %241 0 1 2
%243 = OpCompositeExtract %16 %204 2
%244 = OpVectorShuffle %20 %243 %243 0 1 2
%245 = OpFSub %20 %242 %244
%246 = OpExtInst %20 %1 Normalize %245
%247 = OpDot %6 %220 %246
%248 = OpExtInst %6 %1 FMax %5 %247
%249 = OpLoad %20 %201
%250 = OpFMul %6 %240 %248
%251 = OpCompositeExtract %16 %235 2
%252 = OpVectorShuffle %20 %251 %251 0 1 2
%253 = OpVectorTimesScalar %20 %252 %250
%254 = OpFAdd %20 %249 %253
OpStore %201 %254
OpBranch %224
%224 = OpLabel
%255 = OpLoad %12 %202
%256 = OpIAdd %12 %255 %14
OpStore %202 %256
OpBranch %221
%222 = OpLabel
%257 = OpLoad %20 %201
%258 = OpCompositeConstruct %16 %257 %7
%259 = OpAccessChain %197 %214 %14
%260 = OpLoad %16 %259
%261 = OpFMul %16 %258 %260
OpStore %211 %261
OpReturn
OpFunctionEnd