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