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

195 lines
5.3 KiB
Plaintext

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