Files
wgpu/tests/out/shadow.spvasm
2021-04-20 22:03:54 -04:00

197 lines
5.3 KiB
Plaintext

; SPIR-V
; Version: 1.2
; Generator: rspirv
; Bound: 126
OpCapability Shader
OpExtension "SPV_KHR_storage_buffer_storage_class"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %80 "fs_main" %72 %75 %78
OpExecutionMode %80 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 %67 "color"
OpName %69 "i"
OpName %72 "raw_normal"
OpName %75 "position"
OpName %80 "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 %72 Location 0
OpDecorate %75 Location 1
OpDecorate %78 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
%54 = OpTypeInt 32 1
%59 = OpTypeSampledImage %20
%66 = OpConstant %4 0.0
%68 = OpTypePointer Function %23
%70 = OpTypePointer Function %10
%73 = OpTypePointer Input %23
%72 = OpVariable %73 Input
%76 = OpTypePointer Input %16
%75 = OpVariable %76 Input
%79 = OpTypePointer Output %16
%78 = OpVariable %79 Output
%81 = OpTypeFunction %2
%91 = OpTypePointer Uniform %13
%92 = OpConstant %54 0
%100 = OpTypePointer StorageBuffer %18
%102 = 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 = OpVectorShuffle %22 %35 %35 0 1
%48 = OpFMul %22 %47 %46
%49 = OpCompositeExtract %4 %35 3
%50 = OpCompositeConstruct %22 %49 %49
%51 = OpFDiv %22 %48 %50
%52 = OpCompositeConstruct %22 %6 %6
%53 = OpFAdd %22 %51 %52
%55 = OpBitcast %54 %34
%56 = OpCompositeExtract %4 %35 2
%57 = OpCompositeExtract %4 %35 3
%58 = OpFDiv %4 %56 %57
%60 = OpCompositeExtract %4 %53 0
%61 = OpCompositeExtract %4 %53 1
%62 = OpConvertUToF %4 %55
%63 = OpCompositeConstruct %23 %60 %61 %62
%64 = OpSampledImage %59 %38 %39
%65 = OpImageSampleDrefExplicitLod %4 %64 %63 %58 Lod %66
OpReturnValue %65
OpFunctionEnd
%80 = OpFunction %2 None %81
%71 = OpLabel
%67 = OpVariable %68 Function %24
%69 = OpVariable %70 Function %11
%74 = OpLoad %23 %72
%77 = OpLoad %16 %75
%82 = OpLoad %20 %29
%83 = OpLoad %21 %31
OpBranch %84
%84 = OpLabel
%85 = OpExtInst %23 %1 Normalize %74
OpBranch %86
%86 = OpLabel
OpLoopMerge %87 %89 None
OpBranch %88
%88 = OpLabel
%90 = OpLoad %10 %69
%93 = OpAccessChain %91 %25 %92
%94 = OpLoad %13 %93
%95 = OpCompositeExtract %10 %94 0
%96 = OpExtInst %10 %1 UMin %95 %9
%97 = OpUGreaterThanEqual %42 %90 %96
OpSelectionMerge %98 None
OpBranchConditional %97 %99 %98
%99 = OpLabel
OpBranch %87
%98 = OpLabel
%101 = OpLoad %10 %69
%103 = OpAccessChain %102 %27 %92 %101
%104 = OpLoad %17 %103
%105 = OpLoad %10 %69
%106 = OpCompositeExtract %15 %104 0
%107 = OpMatrixTimesVector %16 %106 %77
%108 = OpFunctionCall %4 %36 %105 %107
%109 = OpCompositeExtract %16 %104 1
%110 = OpVectorShuffle %23 %109 %109 0 1 2
%111 = OpVectorShuffle %23 %77 %77 0 1 2
%112 = OpFSub %23 %110 %111
%113 = OpExtInst %23 %1 Normalize %112
%114 = OpDot %4 %85 %113
%115 = OpExtInst %4 %1 FMax %3 %114
%116 = OpLoad %23 %67
%117 = OpFMul %4 %108 %115
%118 = OpCompositeExtract %16 %104 2
%119 = OpVectorShuffle %23 %118 %118 0 1 2
%120 = OpVectorTimesScalar %23 %119 %117
%121 = OpFAdd %23 %116 %120
OpStore %67 %121
OpBranch %89
%89 = OpLabel
%122 = OpLoad %10 %69
%123 = OpIAdd %10 %122 %12
OpStore %69 %123
OpBranch %86
%87 = OpLabel
%124 = OpLoad %23 %67
%125 = OpCompositeConstruct %16 %124 %5
OpStore %78 %125
OpReturn
OpFunctionEnd