blob: 0d3239b1b86722354c35005782c19fa2c81b62d4 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 264
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "resolution"
OpName %x_24 "x_24"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %cross2d_vf2_vf2_ "cross2d_vf2_vf2_"
OpName %a "a"
OpName %b "b"
OpName %pointInTriangle_vf2_vf2_vf2_vf2_ "pointInTriangle_vf2_vf2_vf2_vf2_"
OpName %p "p"
OpName %a_1 "a_1"
OpName %b_1 "b_1"
OpName %c "c"
OpName %pab "pab"
OpName %param "param"
OpName %param_1 "param_1"
OpName %pbc "pbc"
OpName %param_2 "param_2"
OpName %param_3 "param_3"
OpName %pca "pca"
OpName %param_4 "param_4"
OpName %param_5 "param_5"
OpName %x_145 "x_145"
OpName %x_185 "x_185"
OpName %x_146_phi "x_146_phi"
OpName %x_186_phi "x_186_phi"
OpName %main_1 "main_1"
OpName %pos "pos"
OpName %param_6 "param_6"
OpName %param_7 "param_7"
OpName %param_8 "param_8"
OpName %param_9 "param_9"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_3 "tint_symbol_3"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main "main"
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_24 NonWritable
OpDecorate %x_24 DescriptorSet 0
OpDecorate %x_24 Binding 0
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%5 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %5
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_24 = OpVariable %_ptr_Uniform_buf0 Uniform
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%_ptr_Input_v4float = OpTypePointer Input %v4float
%tint_symbol = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Function_v2float = OpTypePointer Function %v2float
%15 = OpTypeFunction %float %_ptr_Function_v2float %_ptr_Function_v2float
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Function_float = OpTypePointer Function %float
%uint_1 = OpConstant %uint 1
%int = OpTypeInt 32 1
%40 = OpTypeFunction %int %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float
%49 = OpConstantNull %float
%51 = OpConstantNull %v2float
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%62 = OpConstantNull %bool
%float_0 = OpConstant %float 0
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%void = OpTypeVoid
%212 = OpTypeFunction %void
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_0_699999988 = OpConstant %float 0.699999988
%float_0_300000012 = OpConstant %float 0.300000012
%232 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012
%float_0_5 = OpConstant %float 0.5
%float_0_899999976 = OpConstant %float 0.899999976
%235 = OpConstantComposite %v2float %float_0_5 %float_0_899999976
%float_0_100000001 = OpConstant %float 0.100000001
%float_0_400000006 = OpConstant %float 0.400000006
%238 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006
%float_1 = OpConstant %float 1
%249 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%250 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%251 = OpTypeFunction %void %main_out
%cross2d_vf2_vf2_ = OpFunction %float None %15
%a = OpFunctionParameter %_ptr_Function_v2float
%b = OpFunctionParameter %_ptr_Function_v2float
%20 = OpLabel
%25 = OpAccessChain %_ptr_Function_float %a %uint_0
%26 = OpLoad %float %25
%29 = OpAccessChain %_ptr_Function_float %b %uint_1
%30 = OpLoad %float %29
%32 = OpAccessChain %_ptr_Function_float %b %uint_0
%33 = OpLoad %float %32
%35 = OpAccessChain %_ptr_Function_float %a %uint_1
%36 = OpLoad %float %35
%37 = OpFMul %float %26 %30
%38 = OpFMul %float %33 %36
%39 = OpFSub %float %37 %38
OpReturnValue %39
OpFunctionEnd
%pointInTriangle_vf2_vf2_vf2_vf2_ = OpFunction %int None %40
%p = OpFunctionParameter %_ptr_Function_v2float
%a_1 = OpFunctionParameter %_ptr_Function_v2float
%b_1 = OpFunctionParameter %_ptr_Function_v2float
%c = OpFunctionParameter %_ptr_Function_v2float
%47 = OpLabel
%pab = OpVariable %_ptr_Function_float Function %49
%param = OpVariable %_ptr_Function_v2float Function %51
%param_1 = OpVariable %_ptr_Function_v2float Function %51
%pbc = OpVariable %_ptr_Function_float Function %49
%param_2 = OpVariable %_ptr_Function_v2float Function %51
%param_3 = OpVariable %_ptr_Function_v2float Function %51
%pca = OpVariable %_ptr_Function_float Function %49
%param_4 = OpVariable %_ptr_Function_v2float Function %51
%param_5 = OpVariable %_ptr_Function_v2float Function %51
%x_145 = OpVariable %_ptr_Function_bool Function %62
%x_185 = OpVariable %_ptr_Function_bool Function %62
%x_146_phi = OpVariable %_ptr_Function_bool Function %62
%x_186_phi = OpVariable %_ptr_Function_bool Function %62
%67 = OpAccessChain %_ptr_Function_float %p %uint_0
%68 = OpLoad %float %67
%70 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%71 = OpLoad %float %70
%73 = OpAccessChain %_ptr_Function_float %p %uint_1
%74 = OpLoad %float %73
%76 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%77 = OpLoad %float %76
%79 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%80 = OpLoad %float %79
%82 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%83 = OpLoad %float %82
%85 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%86 = OpLoad %float %85
%88 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%89 = OpLoad %float %88
%90 = OpFSub %float %68 %71
%91 = OpFSub %float %74 %77
%92 = OpCompositeConstruct %v2float %90 %91
OpStore %param %92
%93 = OpFSub %float %80 %83
%94 = OpFSub %float %86 %89
%95 = OpCompositeConstruct %v2float %93 %94
OpStore %param_1 %95
%96 = OpFunctionCall %float %cross2d_vf2_vf2_ %param %param_1
OpStore %pab %96
%100 = OpAccessChain %_ptr_Function_float %p %uint_0
%101 = OpLoad %float %100
%103 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%104 = OpLoad %float %103
%106 = OpAccessChain %_ptr_Function_float %p %uint_1
%107 = OpLoad %float %106
%109 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%110 = OpLoad %float %109
%112 = OpAccessChain %_ptr_Function_float %c %uint_0
%113 = OpLoad %float %112
%115 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%116 = OpLoad %float %115
%118 = OpAccessChain %_ptr_Function_float %c %uint_1
%119 = OpLoad %float %118
%121 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%122 = OpLoad %float %121
%123 = OpFSub %float %101 %104
%124 = OpFSub %float %107 %110
%125 = OpCompositeConstruct %v2float %123 %124
OpStore %param_2 %125
%126 = OpFSub %float %113 %116
%127 = OpFSub %float %119 %122
%128 = OpCompositeConstruct %v2float %126 %127
OpStore %param_3 %128
%129 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_2 %param_3
OpStore %pbc %129
%132 = OpLoad %float %pab
%133 = OpLoad %float %pbc
%135 = OpFOrdLessThan %bool %132 %float_0
OpSelectionMerge %136 None
OpBranchConditional %135 %137 %136
%137 = OpLabel
%138 = OpFOrdLessThan %bool %133 %float_0
OpBranch %136
%136 = OpLabel
%139 = OpPhi %bool %135 %47 %138 %137
OpStore %x_146_phi %139
%140 = OpLogicalNot %bool %139
OpSelectionMerge %141 None
OpBranchConditional %140 %142 %141
%142 = OpLabel
%143 = OpLoad %float %pab
%144 = OpLoad %float %pbc
%145 = OpFOrdGreaterThanEqual %bool %143 %float_0
OpSelectionMerge %146 None
OpBranchConditional %145 %147 %146
%147 = OpLabel
%148 = OpFOrdGreaterThanEqual %bool %144 %float_0
OpBranch %146
%146 = OpLabel
%149 = OpPhi %bool %145 %142 %148 %147
OpStore %x_145 %149
%150 = OpLoad %bool %x_145
OpStore %x_146_phi %150
OpBranch %141
%141 = OpLabel
%151 = OpLoad %bool %x_146_phi
%152 = OpLogicalNot %bool %151
OpSelectionMerge %153 None
OpBranchConditional %152 %154 %153
%154 = OpLabel
OpReturnValue %int_0
%153 = OpLabel
%157 = OpAccessChain %_ptr_Function_float %p %uint_0
%158 = OpLoad %float %157
%160 = OpAccessChain %_ptr_Function_float %c %uint_0
%161 = OpLoad %float %160
%163 = OpAccessChain %_ptr_Function_float %p %uint_1
%164 = OpLoad %float %163
%166 = OpAccessChain %_ptr_Function_float %c %uint_1
%167 = OpLoad %float %166
%169 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%170 = OpLoad %float %169
%172 = OpAccessChain %_ptr_Function_float %c %uint_0
%173 = OpLoad %float %172
%175 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%176 = OpLoad %float %175
%178 = OpAccessChain %_ptr_Function_float %c %uint_1
%179 = OpLoad %float %178
%180 = OpFSub %float %158 %161
%181 = OpFSub %float %164 %167
%182 = OpCompositeConstruct %v2float %180 %181
OpStore %param_4 %182
%183 = OpFSub %float %170 %173
%184 = OpFSub %float %176 %179
%185 = OpCompositeConstruct %v2float %183 %184
OpStore %param_5 %185
%186 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_4 %param_5
OpStore %pca %186
%189 = OpLoad %float %pab
%190 = OpLoad %float %pca
%191 = OpFOrdLessThan %bool %189 %float_0
OpSelectionMerge %192 None
OpBranchConditional %191 %193 %192
%193 = OpLabel
%194 = OpFOrdLessThan %bool %190 %float_0
OpBranch %192
%192 = OpLabel
%195 = OpPhi %bool %191 %153 %194 %193
OpStore %x_186_phi %195
%196 = OpLogicalNot %bool %195
OpSelectionMerge %197 None
OpBranchConditional %196 %198 %197
%198 = OpLabel
%199 = OpLoad %float %pab
%200 = OpLoad %float %pca
%201 = OpFOrdGreaterThanEqual %bool %199 %float_0
OpSelectionMerge %202 None
OpBranchConditional %201 %203 %202
%203 = OpLabel
%204 = OpFOrdGreaterThanEqual %bool %200 %float_0
OpBranch %202
%202 = OpLabel
%205 = OpPhi %bool %201 %198 %204 %203
OpStore %x_185 %205
%206 = OpLoad %bool %x_185
OpStore %x_186_phi %206
OpBranch %197
%197 = OpLabel
%207 = OpLoad %bool %x_186_phi
%208 = OpLogicalNot %bool %207
OpSelectionMerge %209 None
OpBranchConditional %208 %210 %209
%210 = OpLabel
OpReturnValue %int_0
%209 = OpLabel
OpReturnValue %int_1
OpFunctionEnd
%main_1 = OpFunction %void None %212
%215 = OpLabel
%pos = OpVariable %_ptr_Function_v2float Function %51
%param_6 = OpVariable %_ptr_Function_v2float Function %51
%param_7 = OpVariable %_ptr_Function_v2float Function %51
%param_8 = OpVariable %_ptr_Function_v2float Function %51
%param_9 = OpVariable %_ptr_Function_v2float Function %51
%221 = OpLoad %v4float %gl_FragCoord
%223 = OpAccessChain %_ptr_Uniform_v2float %x_24 %uint_0
%224 = OpLoad %v2float %223
%225 = OpCompositeExtract %float %221 0
%226 = OpCompositeExtract %float %221 1
%227 = OpCompositeConstruct %v2float %225 %226
%228 = OpFDiv %v2float %227 %224
OpStore %pos %228
%229 = OpLoad %v2float %pos
OpStore %param_6 %229
OpStore %param_7 %232
OpStore %param_8 %235
OpStore %param_9 %238
%239 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9
%244 = OpIEqual %bool %239 %int_1
OpSelectionMerge %245 None
OpBranchConditional %244 %246 %247
%246 = OpLabel
OpStore %x_GLF_color %249
OpBranch %245
%247 = OpLabel
OpStore %x_GLF_color %250
OpBranch %245
%245 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %251
%tint_symbol_1 = OpFunctionParameter %main_out
%255 = OpLabel
%256 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %256
OpReturn
OpFunctionEnd
%main = OpFunction %void None %212
%258 = OpLabel
%259 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %259
%260 = OpFunctionCall %void %main_1
%262 = OpLoad %v4float %x_GLF_color
%263 = OpCompositeConstruct %main_out %262
%261 = OpFunctionCall %void %tint_symbol_3 %263
OpReturn
OpFunctionEnd