blob: bde22d6f9f753c2fc2fcbb985fad2cdaa523a6e6 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 202
; Schema: 0
OpCapability Shader
%84 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %fClipDistance3_param_1 %fClipDistance4_param_1 %glFragColor_1_1
OpExecutionMode %main OriginUpperLeft
OpName %fClipDistance3_param_1 "fClipDistance3_param_1"
OpName %fClipDistance4_param_1 "fClipDistance4_param_1"
OpName %glFragColor_1_1 "glFragColor_1_1"
OpName %fClipDistance3 "fClipDistance3"
OpName %fClipDistance4 "fClipDistance4"
OpName %x_29_block "x_29_block"
OpMemberName %x_29_block 0 "inner"
OpName %Scene "Scene"
OpMemberName %Scene 0 "vEyePosition"
OpName %x_29 "x_29"
OpName %x_49_block "x_49_block"
OpMemberName %x_49_block 0 "inner"
OpName %Material "Material"
OpMemberName %Material 0 "vDiffuseColor"
OpMemberName %Material 1 "vAmbientColor"
OpMemberName %Material 2 "placeholder"
OpMemberName %Material 3 "vEmissiveColor"
OpMemberName %Material 4 "placeholder2"
OpName %x_49 "x_49"
OpName %x_137_block "x_137_block"
OpMemberName %x_137_block 0 "inner"
OpName %Mesh "Mesh"
OpMemberName %Mesh 0 "visibility"
OpName %x_137 "x_137"
OpName %glFragColor "glFragColor"
OpName %tint_discard "tint_discard"
OpName %main_1 "main_1"
OpName %tint_return_flag "tint_return_flag"
OpName %viewDirectionW "viewDirectionW"
OpName %baseColor "baseColor"
OpName %diffuseColor "diffuseColor"
OpName %alpha "alpha"
OpName %normalW "normalW"
OpName %uvOffset "uvOffset"
OpName %baseAmbientColor "baseAmbientColor"
OpName %glossiness "glossiness"
OpName %diffuseBase "diffuseBase"
OpName %shadow "shadow"
OpName %refractionColor "refractionColor"
OpName %reflectionColor "reflectionColor"
OpName %emissiveColor "emissiveColor"
OpName %finalDiffuse "finalDiffuse"
OpName %finalSpecular "finalSpecular"
OpName %color "color"
OpName %tint_discard_func "tint_discard_func"
OpName %main_out "main_out"
OpMemberName %main_out 0 "glFragColor_1"
OpName %main_inner "main_inner"
OpName %fClipDistance3_param "fClipDistance3_param"
OpName %fClipDistance4_param "fClipDistance4_param"
OpName %main "main"
OpDecorate %fClipDistance3_param_1 Location 2
OpDecorate %fClipDistance4_param_1 Location 3
OpDecorate %glFragColor_1_1 Location 0
OpDecorate %x_29_block Block
OpMemberDecorate %x_29_block 0 Offset 0
OpMemberDecorate %Scene 0 Offset 0
OpDecorate %x_29 NonWritable
OpDecorate %x_29 DescriptorSet 0
OpDecorate %x_29 Binding 0
OpDecorate %x_49_block Block
OpMemberDecorate %x_49_block 0 Offset 0
OpMemberDecorate %Material 0 Offset 0
OpMemberDecorate %Material 1 Offset 16
OpMemberDecorate %Material 2 Offset 28
OpMemberDecorate %Material 3 Offset 32
OpMemberDecorate %Material 4 Offset 44
OpDecorate %x_49 NonWritable
OpDecorate %x_49 DescriptorSet 0
OpDecorate %x_49 Binding 1
OpDecorate %x_137_block Block
OpMemberDecorate %x_137_block 0 Offset 0
OpMemberDecorate %Mesh 0 Offset 0
OpDecorate %x_137 NonWritable
OpDecorate %x_137 DescriptorSet 0
OpDecorate %x_137 Binding 2
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%_ptr_Input_float = OpTypePointer Input %float
%fClipDistance3_param_1 = OpVariable %_ptr_Input_float Input
%fClipDistance4_param_1 = OpVariable %_ptr_Input_float Input
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%8 = OpConstantNull %v4float
%glFragColor_1_1 = OpVariable %_ptr_Output_v4float Output %8
%_ptr_Private_float = OpTypePointer Private %float
%11 = OpConstantNull %float
%fClipDistance3 = OpVariable %_ptr_Private_float Private %11
%fClipDistance4 = OpVariable %_ptr_Private_float Private %11
%Scene = OpTypeStruct %v4float
%x_29_block = OpTypeStruct %Scene
%_ptr_Uniform_x_29_block = OpTypePointer Uniform %x_29_block
%x_29 = OpVariable %_ptr_Uniform_x_29_block Uniform
%v3float = OpTypeVector %float 3
%Material = OpTypeStruct %v4float %v3float %float %v3float %float
%x_49_block = OpTypeStruct %Material
%_ptr_Uniform_x_49_block = OpTypePointer Uniform %x_49_block
%x_49 = OpVariable %_ptr_Uniform_x_49_block Uniform
%Mesh = OpTypeStruct %float
%x_137_block = OpTypeStruct %Mesh
%_ptr_Uniform_x_137_block = OpTypePointer Uniform %x_137_block
%x_137 = OpVariable %_ptr_Uniform_x_137_block Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%glFragColor = OpVariable %_ptr_Private_v4float Private %8
%bool = OpTypeBool
%29 = OpConstantNull %bool
%_ptr_Private_bool = OpTypePointer Private %bool
%tint_discard = OpVariable %_ptr_Private_bool Private %29
%void = OpTypeVoid
%32 = OpTypeFunction %void
%_ptr_Function_bool = OpTypePointer Function %bool
%_ptr_Function_v3float = OpTypePointer Function %v3float
%40 = OpConstantNull %v3float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_float = OpTypePointer Function %float
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%50 = OpConstantNull %v2float
%true = OpConstantTrue %bool
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_1 = OpConstant %float 1
%91 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%uint_3 = OpConstant %uint 3
%_ptr_Uniform_float = OpTypePointer Uniform %float
%118 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%119 = OpConstantComposite %v4float %11 %11 %11 %float_1
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
%uint_1 = OpConstant %uint 1
%main_out = OpTypeStruct %v4float
%182 = OpTypeFunction %main_out %float %float
%193 = OpConstantNull %main_out
%main_1 = OpFunction %void None %32
%35 = OpLabel
%tint_return_flag = OpVariable %_ptr_Function_bool Function %29
%viewDirectionW = OpVariable %_ptr_Function_v3float Function %40
%baseColor = OpVariable %_ptr_Function_v4float Function %8
%diffuseColor = OpVariable %_ptr_Function_v3float Function %40
%alpha = OpVariable %_ptr_Function_float Function %11
%normalW = OpVariable %_ptr_Function_v3float Function %40
%uvOffset = OpVariable %_ptr_Function_v2float Function %50
%baseAmbientColor = OpVariable %_ptr_Function_v3float Function %40
%glossiness = OpVariable %_ptr_Function_float Function %11
%diffuseBase = OpVariable %_ptr_Function_v3float Function %40
%shadow = OpVariable %_ptr_Function_float Function %11
%refractionColor = OpVariable %_ptr_Function_v4float Function %8
%reflectionColor = OpVariable %_ptr_Function_v4float Function %8
%emissiveColor = OpVariable %_ptr_Function_v3float Function %40
%finalDiffuse = OpVariable %_ptr_Function_v3float Function %40
%finalSpecular = OpVariable %_ptr_Function_v3float Function %40
%color = OpVariable %_ptr_Function_v4float Function %8
%61 = OpLoad %float %fClipDistance3
%62 = OpFOrdGreaterThan %bool %61 %11
OpSelectionMerge %63 None
OpBranchConditional %62 %64 %63
%64 = OpLabel
OpStore %tint_discard %true
OpStore %tint_return_flag %true
OpBranch %63
%63 = OpLabel
%67 = OpLoad %bool %tint_return_flag
%66 = OpLogicalNot %bool %67
OpSelectionMerge %68 None
OpBranchConditional %66 %69 %68
%69 = OpLabel
%70 = OpLoad %float %fClipDistance4
%71 = OpFOrdGreaterThan %bool %70 %11
OpSelectionMerge %72 None
OpBranchConditional %71 %73 %72
%73 = OpLabel
OpStore %tint_discard %true
OpStore %tint_return_flag %true
OpBranch %72
%72 = OpLabel
%75 = OpLoad %bool %tint_return_flag
%74 = OpLogicalNot %bool %75
OpSelectionMerge %76 None
OpBranchConditional %74 %77 %76
%77 = OpLabel
%81 = OpAccessChain %_ptr_Uniform_v4float %x_29 %uint_0 %uint_0
%82 = OpLoad %v4float %81
%85 = OpCompositeExtract %float %82 0
%86 = OpCompositeExtract %float %82 1
%87 = OpCompositeExtract %float %82 2
%88 = OpCompositeConstruct %v3float %85 %86 %87
%89 = OpFSub %v3float %88 %40
%83 = OpExtInst %v3float %84 Normalize %89
OpStore %viewDirectionW %83
OpStore %baseColor %91
%92 = OpAccessChain %_ptr_Uniform_v4float %x_49 %uint_0 %uint_0
%93 = OpLoad %v4float %92
%94 = OpCompositeExtract %float %93 0
%95 = OpCompositeExtract %float %93 1
%96 = OpCompositeExtract %float %93 2
%97 = OpCompositeConstruct %v3float %94 %95 %96
OpStore %diffuseColor %97
%100 = OpAccessChain %_ptr_Uniform_float %x_49 %uint_0 %uint_0 %uint_3
%101 = OpLoad %float %100
OpStore %alpha %101
OpStore %uvOffset %50
%102 = OpLoad %v4float %baseColor
%103 = OpCompositeExtract %float %102 0
%104 = OpCompositeExtract %float %102 1
%105 = OpCompositeExtract %float %102 2
%106 = OpCompositeConstruct %v3float %103 %104 %105
%107 = OpCompositeExtract %float %8 0
%108 = OpCompositeExtract %float %8 1
%109 = OpCompositeExtract %float %8 2
%110 = OpCompositeConstruct %v3float %107 %108 %109
%111 = OpFMul %v3float %106 %110
%112 = OpLoad %v4float %baseColor
%113 = OpCompositeExtract %float %111 0
%114 = OpCompositeExtract %float %111 1
%115 = OpCompositeExtract %float %111 2
%116 = OpCompositeExtract %float %112 3
%117 = OpCompositeConstruct %v4float %113 %114 %115 %116
OpStore %baseColor %117
OpStore %baseAmbientColor %118
OpStore %glossiness %11
OpStore %diffuseBase %40
OpStore %shadow %float_1
OpStore %refractionColor %119
OpStore %reflectionColor %119
%121 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_0 %uint_3
%122 = OpLoad %v3float %121
OpStore %emissiveColor %122
%123 = OpLoad %v3float %diffuseBase
%124 = OpLoad %v3float %diffuseColor
%125 = OpLoad %v3float %emissiveColor
%127 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_0 %uint_1
%128 = OpLoad %v3float %127
%129 = OpLoad %v4float %baseColor
%131 = OpFMul %v3float %123 %124
%132 = OpFAdd %v3float %131 %125
%133 = OpFAdd %v3float %132 %128
%130 = OpExtInst %v3float %84 NClamp %133 %40 %118
%134 = OpCompositeExtract %float %129 0
%135 = OpCompositeExtract %float %129 1
%136 = OpCompositeExtract %float %129 2
%137 = OpCompositeConstruct %v3float %134 %135 %136
%138 = OpFMul %v3float %130 %137
OpStore %finalDiffuse %138
OpStore %finalSpecular %40
%139 = OpLoad %v3float %finalDiffuse
%140 = OpLoad %v3float %baseAmbientColor
%141 = OpLoad %v3float %finalSpecular
%142 = OpLoad %v4float %reflectionColor
%143 = OpLoad %v4float %refractionColor
%144 = OpFMul %v3float %139 %140
%145 = OpFAdd %v3float %144 %141
%146 = OpCompositeExtract %float %142 0
%147 = OpCompositeExtract %float %142 1
%148 = OpCompositeExtract %float %142 2
%149 = OpCompositeConstruct %v3float %146 %147 %148
%150 = OpFAdd %v3float %145 %149
%151 = OpCompositeExtract %float %143 0
%152 = OpCompositeExtract %float %143 1
%153 = OpCompositeExtract %float %143 2
%154 = OpCompositeConstruct %v3float %151 %152 %153
%155 = OpFAdd %v3float %150 %154
%156 = OpLoad %float %alpha
%157 = OpCompositeExtract %float %155 0
%158 = OpCompositeExtract %float %155 1
%159 = OpCompositeExtract %float %155 2
%160 = OpCompositeConstruct %v4float %157 %158 %159 %156
OpStore %color %160
%161 = OpLoad %v4float %color
%163 = OpCompositeExtract %float %161 0
%164 = OpCompositeExtract %float %161 1
%165 = OpCompositeExtract %float %161 2
%166 = OpCompositeConstruct %v3float %163 %164 %165
%162 = OpExtInst %v3float %84 NMax %166 %40
%167 = OpLoad %v4float %color
%168 = OpCompositeExtract %float %162 0
%169 = OpCompositeExtract %float %162 1
%170 = OpCompositeExtract %float %162 2
%171 = OpCompositeExtract %float %167 3
%172 = OpCompositeConstruct %v4float %168 %169 %170 %171
OpStore %color %172
%173 = OpAccessChain %_ptr_Uniform_float %x_137 %uint_0 %uint_0
%174 = OpLoad %float %173
%175 = OpAccessChain %_ptr_Function_float %color %uint_3
%176 = OpLoad %float %175
%177 = OpAccessChain %_ptr_Function_float %color %uint_3
%178 = OpFMul %float %176 %174
OpStore %177 %178
%179 = OpLoad %v4float %color
OpStore %glFragColor %179
OpStore %tint_return_flag %true
OpBranch %76
%76 = OpLabel
OpBranch %68
%68 = OpLabel
OpReturn
OpFunctionEnd
%tint_discard_func = OpFunction %void None %32
%181 = OpLabel
OpKill
OpFunctionEnd
%main_inner = OpFunction %main_out None %182
%fClipDistance3_param = OpFunctionParameter %float
%fClipDistance4_param = OpFunctionParameter %float
%187 = OpLabel
OpStore %fClipDistance3 %fClipDistance3_param
OpStore %fClipDistance4 %fClipDistance4_param
%188 = OpFunctionCall %void %main_1
%189 = OpLoad %bool %tint_discard
OpSelectionMerge %190 None
OpBranchConditional %189 %191 %190
%191 = OpLabel
%192 = OpFunctionCall %void %tint_discard_func
OpReturnValue %193
%190 = OpLabel
%194 = OpLoad %v4float %glFragColor
%195 = OpCompositeConstruct %main_out %194
OpReturnValue %195
OpFunctionEnd
%main = OpFunction %void None %32
%197 = OpLabel
%199 = OpLoad %float %fClipDistance3_param_1
%200 = OpLoad %float %fClipDistance4_param_1
%198 = OpFunctionCall %main_out %main_inner %199 %200
%201 = OpCompositeExtract %v4float %198 0
OpStore %glFragColor_1_1 %201
OpReturn
OpFunctionEnd