| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 257 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint Fragment %main "main" %gl_FragCoord_param_1 %x_GLF_color_1_1 |
| OpExecutionMode %main OriginUpperLeft |
| OpName %gl_FragCoord_param_1 "gl_FragCoord_param_1" |
| OpName %x_GLF_color_1_1 "x_GLF_color_1_1" |
| 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 %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 %x_90 "x_90" |
| OpName %x_91 "x_91" |
| 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_140 "x_140" |
| OpName %x_168 "x_168" |
| OpName %x_141_phi "x_141_phi" |
| OpName %x_169_phi "x_169_phi" |
| OpName %x_173_phi "x_173_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 %main_inner "main_inner" |
| OpName %gl_FragCoord_param "gl_FragCoord_param" |
| OpName %main "main" |
| OpDecorate %gl_FragCoord_param_1 BuiltIn FragCoord |
| OpDecorate %x_GLF_color_1_1 Location 0 |
| OpDecorate %buf0 Block |
| OpMemberDecorate %buf0 0 Offset 0 |
| OpDecorate %x_24 NonWritable |
| OpDecorate %x_24 DescriptorSet 0 |
| OpDecorate %x_24 Binding 0 |
| OpMemberDecorate %main_out 0 Offset 0 |
| %float = OpTypeFloat 32 |
| %v4float = OpTypeVector %float 4 |
| %_ptr_Input_v4float = OpTypePointer Input %v4float |
| %gl_FragCoord_param_1 = OpVariable %_ptr_Input_v4float Input |
| %_ptr_Output_v4float = OpTypePointer Output %v4float |
| %7 = OpConstantNull %v4float |
| %x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %7 |
| %_ptr_Private_v4float = OpTypePointer Private %v4float |
| %gl_FragCoord = OpVariable %_ptr_Private_v4float Private %7 |
| %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 %7 |
| %_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 |
| %bool = OpTypeBool |
| %false = OpConstantFalse %bool |
| %_ptr_Function_bool = OpTypePointer Function %bool |
| %52 = OpConstantNull %bool |
| %_ptr_Function_int = OpTypePointer Function %int |
| %55 = OpConstantNull %int |
| %57 = OpConstantNull %float |
| %59 = OpConstantNull %v2float |
| %float_0 = OpConstant %float 0 |
| %true = OpConstantTrue %bool |
| %int_0 = OpConstant %int 0 |
| %int_1 = OpConstant %int 1 |
| %void = OpTypeVoid |
| %206 = OpTypeFunction %void |
| %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float |
| %float_0_699999988 = OpConstant %float 0.699999988 |
| %float_0_300000012 = OpConstant %float 0.300000012 |
| %225 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012 |
| %float_0_5 = OpConstant %float 0.5 |
| %float_0_899999976 = OpConstant %float 0.899999976 |
| %228 = OpConstantComposite %v2float %float_0_5 %float_0_899999976 |
| %float_0_100000001 = OpConstant %float 0.100000001 |
| %float_0_400000006 = OpConstant %float 0.400000006 |
| %231 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006 |
| %float_1 = OpConstant %float 1 |
| %242 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1 |
| %243 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1 |
| %main_out = OpTypeStruct %v4float |
| %244 = OpTypeFunction %main_out %v4float |
| %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 |
| %x_90 = OpVariable %_ptr_Function_bool Function %52 |
| %x_91 = OpVariable %_ptr_Function_int Function %55 |
| %pab = OpVariable %_ptr_Function_float Function %57 |
| %param = OpVariable %_ptr_Function_v2float Function %59 |
| %param_1 = OpVariable %_ptr_Function_v2float Function %59 |
| %pbc = OpVariable %_ptr_Function_float Function %57 |
| %param_2 = OpVariable %_ptr_Function_v2float Function %59 |
| %param_3 = OpVariable %_ptr_Function_v2float Function %59 |
| %pca = OpVariable %_ptr_Function_float Function %57 |
| %param_4 = OpVariable %_ptr_Function_v2float Function %59 |
| %param_5 = OpVariable %_ptr_Function_v2float Function %59 |
| %x_140 = OpVariable %_ptr_Function_bool Function %52 |
| %x_168 = OpVariable %_ptr_Function_bool Function %52 |
| %x_141_phi = OpVariable %_ptr_Function_bool Function %52 |
| %x_169_phi = OpVariable %_ptr_Function_bool Function %52 |
| %x_173_phi = OpVariable %_ptr_Function_int Function %55 |
| OpStore %x_90 %false |
| OpSelectionMerge %72 None |
| OpSwitch %uint_0 %73 |
| %73 = OpLabel |
| %75 = OpAccessChain %_ptr_Function_float %p %uint_0 |
| %76 = OpLoad %float %75 |
| %78 = OpAccessChain %_ptr_Function_float %a_1 %uint_0 |
| %79 = OpLoad %float %78 |
| %81 = OpAccessChain %_ptr_Function_float %p %uint_1 |
| %82 = OpLoad %float %81 |
| %84 = OpAccessChain %_ptr_Function_float %a_1 %uint_1 |
| %85 = OpLoad %float %84 |
| %87 = OpAccessChain %_ptr_Function_float %b_1 %uint_0 |
| %88 = OpLoad %float %87 |
| %90 = OpAccessChain %_ptr_Function_float %a_1 %uint_0 |
| %91 = OpLoad %float %90 |
| %93 = OpAccessChain %_ptr_Function_float %b_1 %uint_1 |
| %94 = OpLoad %float %93 |
| %96 = OpAccessChain %_ptr_Function_float %a_1 %uint_1 |
| %97 = OpLoad %float %96 |
| %98 = OpFSub %float %76 %79 |
| %99 = OpFSub %float %82 %85 |
| %100 = OpCompositeConstruct %v2float %98 %99 |
| OpStore %param %100 |
| %101 = OpFSub %float %88 %91 |
| %102 = OpFSub %float %94 %97 |
| %103 = OpCompositeConstruct %v2float %101 %102 |
| OpStore %param_1 %103 |
| %104 = OpFunctionCall %float %cross2d_vf2_vf2_ %param %param_1 |
| OpStore %pab %104 |
| %108 = OpAccessChain %_ptr_Function_float %p %uint_0 |
| %109 = OpLoad %float %108 |
| %111 = OpAccessChain %_ptr_Function_float %b_1 %uint_0 |
| %112 = OpLoad %float %111 |
| %114 = OpAccessChain %_ptr_Function_float %p %uint_1 |
| %115 = OpLoad %float %114 |
| %117 = OpAccessChain %_ptr_Function_float %b_1 %uint_1 |
| %118 = OpLoad %float %117 |
| %120 = OpAccessChain %_ptr_Function_float %c %uint_0 |
| %121 = OpLoad %float %120 |
| %123 = OpAccessChain %_ptr_Function_float %b_1 %uint_0 |
| %124 = OpLoad %float %123 |
| %126 = OpAccessChain %_ptr_Function_float %c %uint_1 |
| %127 = OpLoad %float %126 |
| %129 = OpAccessChain %_ptr_Function_float %b_1 %uint_1 |
| %130 = OpLoad %float %129 |
| %131 = OpFSub %float %109 %112 |
| %132 = OpFSub %float %115 %118 |
| %133 = OpCompositeConstruct %v2float %131 %132 |
| OpStore %param_2 %133 |
| %134 = OpFSub %float %121 %124 |
| %135 = OpFSub %float %127 %130 |
| %136 = OpCompositeConstruct %v2float %134 %135 |
| OpStore %param_3 %136 |
| %137 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_2 %param_3 |
| OpStore %pbc %137 |
| %141 = OpFOrdLessThan %bool %104 %float_0 |
| %142 = OpFOrdLessThan %bool %137 %float_0 |
| %143 = OpLogicalAnd %bool %141 %142 |
| OpStore %x_141_phi %143 |
| %144 = OpLogicalNot %bool %143 |
| OpSelectionMerge %145 None |
| OpBranchConditional %144 %146 %145 |
| %146 = OpLabel |
| %147 = OpFOrdGreaterThanEqual %bool %104 %float_0 |
| %148 = OpFOrdGreaterThanEqual %bool %137 %float_0 |
| %149 = OpLogicalAnd %bool %147 %148 |
| OpStore %x_140 %149 |
| %150 = OpLoad %bool %x_140 |
| OpStore %x_141_phi %150 |
| OpBranch %145 |
| %145 = OpLabel |
| %151 = OpLoad %bool %x_141_phi |
| %152 = OpLogicalNot %bool %151 |
| OpSelectionMerge %153 None |
| OpBranchConditional %152 %154 %153 |
| %154 = OpLabel |
| OpStore %x_90 %true |
| OpStore %x_91 %int_0 |
| OpStore %x_173_phi %int_0 |
| OpBranch %72 |
| %153 = OpLabel |
| %158 = OpAccessChain %_ptr_Function_float %p %uint_0 |
| %159 = OpLoad %float %158 |
| %161 = OpAccessChain %_ptr_Function_float %c %uint_0 |
| %162 = OpLoad %float %161 |
| %164 = OpAccessChain %_ptr_Function_float %p %uint_1 |
| %165 = OpLoad %float %164 |
| %167 = OpAccessChain %_ptr_Function_float %c %uint_1 |
| %168 = OpLoad %float %167 |
| %170 = OpAccessChain %_ptr_Function_float %a_1 %uint_0 |
| %171 = OpLoad %float %170 |
| %173 = OpAccessChain %_ptr_Function_float %c %uint_0 |
| %174 = OpLoad %float %173 |
| %176 = OpAccessChain %_ptr_Function_float %a_1 %uint_1 |
| %177 = OpLoad %float %176 |
| %179 = OpAccessChain %_ptr_Function_float %c %uint_1 |
| %180 = OpLoad %float %179 |
| %181 = OpFSub %float %159 %162 |
| %182 = OpFSub %float %165 %168 |
| %183 = OpCompositeConstruct %v2float %181 %182 |
| OpStore %param_4 %183 |
| %184 = OpFSub %float %171 %174 |
| %185 = OpFSub %float %177 %180 |
| %186 = OpCompositeConstruct %v2float %184 %185 |
| OpStore %param_5 %186 |
| %187 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_4 %param_5 |
| OpStore %pca %187 |
| %190 = OpFOrdLessThan %bool %104 %float_0 |
| %191 = OpFOrdLessThan %bool %187 %float_0 |
| %192 = OpLogicalAnd %bool %190 %191 |
| OpStore %x_169_phi %192 |
| %193 = OpLogicalNot %bool %192 |
| OpSelectionMerge %194 None |
| OpBranchConditional %193 %195 %194 |
| %195 = OpLabel |
| %196 = OpFOrdGreaterThanEqual %bool %104 %float_0 |
| %197 = OpFOrdGreaterThanEqual %bool %187 %float_0 |
| %198 = OpLogicalAnd %bool %196 %197 |
| OpStore %x_168 %198 |
| %199 = OpLoad %bool %x_168 |
| OpStore %x_169_phi %199 |
| OpBranch %194 |
| %194 = OpLabel |
| %200 = OpLoad %bool %x_169_phi |
| %201 = OpLogicalNot %bool %200 |
| OpSelectionMerge %202 None |
| OpBranchConditional %201 %203 %202 |
| %203 = OpLabel |
| OpStore %x_90 %true |
| OpStore %x_91 %int_0 |
| OpStore %x_173_phi %int_0 |
| OpBranch %72 |
| %202 = OpLabel |
| OpStore %x_90 %true |
| OpStore %x_91 %int_1 |
| OpStore %x_173_phi %int_1 |
| OpBranch %72 |
| %72 = OpLabel |
| %205 = OpLoad %int %x_173_phi |
| OpReturnValue %205 |
| OpFunctionEnd |
| %main_1 = OpFunction %void None %206 |
| %209 = OpLabel |
| %pos = OpVariable %_ptr_Function_v2float Function %59 |
| %param_6 = OpVariable %_ptr_Function_v2float Function %59 |
| %param_7 = OpVariable %_ptr_Function_v2float Function %59 |
| %param_8 = OpVariable %_ptr_Function_v2float Function %59 |
| %param_9 = OpVariable %_ptr_Function_v2float Function %59 |
| %215 = OpLoad %v4float %gl_FragCoord |
| %217 = OpAccessChain %_ptr_Uniform_v2float %x_24 %uint_0 |
| %218 = OpLoad %v2float %217 |
| %219 = OpCompositeExtract %float %215 0 |
| %220 = OpCompositeExtract %float %215 1 |
| %221 = OpCompositeConstruct %v2float %219 %220 |
| %222 = OpFDiv %v2float %221 %218 |
| OpStore %pos %222 |
| OpStore %param_6 %222 |
| OpStore %param_7 %225 |
| OpStore %param_8 %228 |
| OpStore %param_9 %231 |
| %232 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9 |
| %237 = OpIEqual %bool %232 %int_1 |
| OpSelectionMerge %238 None |
| OpBranchConditional %237 %239 %240 |
| %239 = OpLabel |
| OpStore %x_GLF_color %242 |
| OpBranch %238 |
| %240 = OpLabel |
| OpStore %x_GLF_color %243 |
| OpBranch %238 |
| %238 = OpLabel |
| OpReturn |
| OpFunctionEnd |
| %main_inner = OpFunction %main_out None %244 |
| %gl_FragCoord_param = OpFunctionParameter %v4float |
| %248 = OpLabel |
| OpStore %gl_FragCoord %gl_FragCoord_param |
| %249 = OpFunctionCall %void %main_1 |
| %250 = OpLoad %v4float %x_GLF_color |
| %251 = OpCompositeConstruct %main_out %250 |
| OpReturnValue %251 |
| OpFunctionEnd |
| %main = OpFunction %void None %206 |
| %253 = OpLabel |
| %255 = OpLoad %v4float %gl_FragCoord_param_1 |
| %254 = OpFunctionCall %main_out %main_inner %255 |
| %256 = OpCompositeExtract %v4float %254 0 |
| OpStore %x_GLF_color_1_1 %256 |
| OpReturn |
| OpFunctionEnd |