mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 09:09:19 +01:00
208 lines
5.7 KiB
Plaintext
208 lines
5.7 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.2
|
|
; Generator: rspirv
|
|
; Bound: 137
|
|
OpCapability Shader
|
|
OpExtension "SPV_KHR_storage_buffer_storage_class"
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint Fragment %82 "fs_main" %74 %77 %80
|
|
OpExecutionMode %82 OriginUpperLeft
|
|
OpSource GLSL 450
|
|
OpName %9 "c_max_lights"
|
|
OpName %14 "Globals"
|
|
OpMemberName %14 0 "num_lights"
|
|
OpName %17 "Light"
|
|
OpMemberName %17 0 "proj"
|
|
OpMemberName %17 1 "pos"
|
|
OpMemberName %17 2 "color"
|
|
OpName %19 "Lights"
|
|
OpMemberName %19 0 "data"
|
|
OpName %24 "c_ambient"
|
|
OpName %25 "u_globals"
|
|
OpName %27 "s_lights"
|
|
OpName %29 "t_shadow"
|
|
OpName %31 "sampler_shadow"
|
|
OpName %36 "fetch_shadow"
|
|
OpName %69 "color"
|
|
OpName %71 "i"
|
|
OpName %74 "raw_normal"
|
|
OpName %77 "position"
|
|
OpName %82 "fs_main"
|
|
OpDecorate %14 Block
|
|
OpMemberDecorate %14 0 Offset 0
|
|
OpMemberDecorate %17 0 Offset 0
|
|
OpMemberDecorate %17 0 ColMajor
|
|
OpMemberDecorate %17 0 MatrixStride 16
|
|
OpMemberDecorate %17 1 Offset 64
|
|
OpMemberDecorate %17 2 Offset 80
|
|
OpDecorate %18 ArrayStride 96
|
|
OpDecorate %19 Block
|
|
OpMemberDecorate %19 0 Offset 0
|
|
OpDecorate %25 DescriptorSet 0
|
|
OpDecorate %25 Binding 0
|
|
OpDecorate %27 NonWritable
|
|
OpDecorate %27 DescriptorSet 0
|
|
OpDecorate %27 Binding 1
|
|
OpDecorate %29 DescriptorSet 0
|
|
OpDecorate %29 Binding 2
|
|
OpDecorate %31 DescriptorSet 0
|
|
OpDecorate %31 Binding 3
|
|
OpDecorate %74 Location 0
|
|
OpDecorate %77 Location 1
|
|
OpDecorate %80 Location 0
|
|
%2 = OpTypeVoid
|
|
%4 = OpTypeFloat 32
|
|
%3 = OpConstant %4 0.0
|
|
%5 = OpConstant %4 1.0
|
|
%6 = OpConstant %4 0.5
|
|
%7 = OpConstant %4 -0.5
|
|
%8 = OpConstant %4 0.05
|
|
%10 = OpTypeInt 32 0
|
|
%9 = OpConstant %10 10
|
|
%11 = OpConstant %10 0
|
|
%12 = OpConstant %10 1
|
|
%13 = OpTypeVector %10 4
|
|
%14 = OpTypeStruct %13
|
|
%16 = OpTypeVector %4 4
|
|
%15 = OpTypeMatrix %16 4
|
|
%17 = OpTypeStruct %15 %16 %16
|
|
%18 = OpTypeRuntimeArray %17
|
|
%19 = OpTypeStruct %18
|
|
%20 = OpTypeImage %4 2D 1 1 0 1 Unknown
|
|
%21 = OpTypeSampler
|
|
%22 = OpTypeVector %4 2
|
|
%23 = OpTypeVector %4 3
|
|
%24 = OpConstantComposite %23 %8 %8 %8
|
|
%26 = OpTypePointer Uniform %14
|
|
%25 = OpVariable %26 Uniform
|
|
%28 = OpTypePointer StorageBuffer %19
|
|
%27 = OpVariable %28 StorageBuffer
|
|
%30 = OpTypePointer UniformConstant %20
|
|
%29 = OpVariable %30 UniformConstant
|
|
%32 = OpTypePointer UniformConstant %21
|
|
%31 = OpVariable %32 UniformConstant
|
|
%37 = OpTypeFunction %4 %10 %16
|
|
%42 = OpTypeBool
|
|
%56 = OpTypeInt 32 1
|
|
%61 = OpTypeSampledImage %20
|
|
%68 = OpConstant %4 0.0
|
|
%70 = OpTypePointer Function %23
|
|
%72 = OpTypePointer Function %10
|
|
%75 = OpTypePointer Input %23
|
|
%74 = OpVariable %75 Input
|
|
%78 = OpTypePointer Input %16
|
|
%77 = OpVariable %78 Input
|
|
%81 = OpTypePointer Output %16
|
|
%80 = OpVariable %81 Output
|
|
%83 = OpTypeFunction %2
|
|
%93 = OpTypePointer Uniform %13
|
|
%94 = OpConstant %56 0
|
|
%102 = OpTypePointer StorageBuffer %18
|
|
%104 = OpTypePointer StorageBuffer %17
|
|
%36 = OpFunction %4 None %37
|
|
%34 = OpFunctionParameter %10
|
|
%35 = OpFunctionParameter %16
|
|
%33 = OpLabel
|
|
%38 = OpLoad %20 %29
|
|
%39 = OpLoad %21 %31
|
|
OpBranch %40
|
|
%40 = OpLabel
|
|
%41 = OpCompositeExtract %4 %35 3
|
|
%43 = OpFOrdLessThanEqual %42 %41 %3
|
|
OpSelectionMerge %44 None
|
|
OpBranchConditional %43 %45 %44
|
|
%45 = OpLabel
|
|
OpReturnValue %5
|
|
%44 = OpLabel
|
|
%46 = OpCompositeConstruct %22 %6 %7
|
|
%47 = OpCompositeExtract %4 %35 0
|
|
%48 = OpCompositeExtract %4 %35 1
|
|
%49 = OpCompositeConstruct %22 %47 %48
|
|
%50 = OpFMul %22 %49 %46
|
|
%51 = OpCompositeExtract %4 %35 3
|
|
%52 = OpCompositeConstruct %22 %51 %51
|
|
%53 = OpFDiv %22 %50 %52
|
|
%54 = OpCompositeConstruct %22 %6 %6
|
|
%55 = OpFAdd %22 %53 %54
|
|
%57 = OpBitcast %56 %34
|
|
%58 = OpCompositeExtract %4 %35 2
|
|
%59 = OpCompositeExtract %4 %35 3
|
|
%60 = OpFDiv %4 %58 %59
|
|
%62 = OpCompositeExtract %4 %55 0
|
|
%63 = OpCompositeExtract %4 %55 1
|
|
%64 = OpConvertUToF %4 %57
|
|
%65 = OpCompositeConstruct %23 %62 %63 %64
|
|
%66 = OpSampledImage %61 %38 %39
|
|
%67 = OpImageSampleDrefExplicitLod %4 %66 %65 %60 Lod %68
|
|
OpReturnValue %67
|
|
OpFunctionEnd
|
|
%82 = OpFunction %2 None %83
|
|
%73 = OpLabel
|
|
%69 = OpVariable %70 Function %24
|
|
%71 = OpVariable %72 Function %11
|
|
%76 = OpLoad %23 %74
|
|
%79 = OpLoad %16 %77
|
|
%84 = OpLoad %20 %29
|
|
%85 = OpLoad %21 %31
|
|
OpBranch %86
|
|
%86 = OpLabel
|
|
%87 = OpExtInst %23 %1 Normalize %76
|
|
OpBranch %88
|
|
%88 = OpLabel
|
|
OpLoopMerge %89 %91 None
|
|
OpBranch %90
|
|
%90 = OpLabel
|
|
%92 = OpLoad %10 %71
|
|
%95 = OpAccessChain %93 %25 %94
|
|
%96 = OpLoad %13 %95
|
|
%97 = OpCompositeExtract %10 %96 0
|
|
%98 = OpExtInst %10 %1 UMin %97 %9
|
|
%99 = OpUGreaterThanEqual %42 %92 %98
|
|
OpSelectionMerge %100 None
|
|
OpBranchConditional %99 %101 %100
|
|
%101 = OpLabel
|
|
OpBranch %89
|
|
%100 = OpLabel
|
|
%103 = OpLoad %10 %71
|
|
%105 = OpAccessChain %104 %27 %94 %103
|
|
%106 = OpLoad %17 %105
|
|
%107 = OpLoad %10 %71
|
|
%108 = OpCompositeExtract %15 %106 0
|
|
%109 = OpMatrixTimesVector %16 %108 %79
|
|
%110 = OpFunctionCall %4 %36 %107 %109
|
|
%111 = OpCompositeExtract %16 %106 1
|
|
%112 = OpCompositeExtract %4 %111 0
|
|
%113 = OpCompositeExtract %4 %111 1
|
|
%114 = OpCompositeExtract %4 %111 2
|
|
%115 = OpCompositeConstruct %23 %112 %113 %114
|
|
%116 = OpCompositeExtract %4 %79 0
|
|
%117 = OpCompositeExtract %4 %79 1
|
|
%118 = OpCompositeExtract %4 %79 2
|
|
%119 = OpCompositeConstruct %23 %116 %117 %118
|
|
%120 = OpFSub %23 %115 %119
|
|
%121 = OpExtInst %23 %1 Normalize %120
|
|
%122 = OpDot %4 %87 %121
|
|
%123 = OpExtInst %4 %1 FMax %3 %122
|
|
%124 = OpLoad %23 %69
|
|
%125 = OpFMul %4 %110 %123
|
|
%126 = OpCompositeExtract %16 %106 2
|
|
%127 = OpCompositeExtract %4 %126 0
|
|
%128 = OpCompositeExtract %4 %126 1
|
|
%129 = OpCompositeExtract %4 %126 2
|
|
%130 = OpCompositeConstruct %23 %127 %128 %129
|
|
%131 = OpVectorTimesScalar %23 %130 %125
|
|
%132 = OpFAdd %23 %124 %131
|
|
OpStore %69 %132
|
|
OpBranch %91
|
|
%91 = OpLabel
|
|
%133 = OpLoad %10 %71
|
|
%134 = OpIAdd %10 %133 %12
|
|
OpStore %71 %134
|
|
OpBranch %88
|
|
%89 = OpLabel
|
|
%135 = OpLoad %23 %69
|
|
%136 = OpCompositeConstruct %16 %135 %5
|
|
OpStore %80 %136
|
|
OpReturn
|
|
OpFunctionEnd |