| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 300 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2 |
| OpExecutionMode %main OriginUpperLeft |
| OpName %buf1 "buf1" |
| OpMemberName %buf1 0 "injectionSwitch" |
| OpName %x_11 "x_11" |
| OpName %x_GLF_color "x_GLF_color" |
| OpName %gl_FragCoord "gl_FragCoord" |
| OpName %buf0 "buf0" |
| OpMemberName %buf0 0 "resolution" |
| OpName %x_19 "x_19" |
| OpName %tint_symbol "tint_symbol" |
| OpName %tint_symbol_2 "tint_symbol_2" |
| OpName %pointInTriangle_vf2_vf2_vf2_vf2_ "pointInTriangle_vf2_vf2_vf2_vf2_" |
| OpName %p "p" |
| OpName %a "a" |
| OpName %b "b" |
| OpName %c "c" |
| OpName %x_78 "x_78" |
| OpName %x_79 "x_79" |
| OpName %x_80 "x_80" |
| OpName %param "param" |
| OpName %param_1 "param_1" |
| OpName %param_2 "param_2" |
| OpName %param_3 "param_3" |
| OpName %param_4 "param_4" |
| OpName %param_5 "param_5" |
| OpName %x_147 "x_147" |
| OpName %x_203 "x_203" |
| OpName %x_148_phi "x_148_phi" |
| OpName %x_204_phi "x_204_phi" |
| OpName %x_153_phi "x_153_phi" |
| OpName %x_154 "x_154" |
| OpName %x_164_phi "x_164_phi" |
| OpName %x_165 "x_165" |
| OpName %main_1 "main_1" |
| 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 %buf1 Block |
| OpMemberDecorate %buf1 0 Offset 0 |
| OpDecorate %x_11 NonWritable |
| OpDecorate %x_11 DescriptorSet 0 |
| OpDecorate %x_11 Binding 1 |
| OpDecorate %buf0 Block |
| OpMemberDecorate %buf0 0 Offset 0 |
| OpDecorate %x_19 NonWritable |
| OpDecorate %x_19 DescriptorSet 0 |
| OpDecorate %x_19 Binding 0 |
| OpDecorate %tint_symbol BuiltIn FragCoord |
| OpDecorate %tint_symbol_2 Location 0 |
| OpMemberDecorate %main_out 0 Offset 0 |
| %float = OpTypeFloat 32 |
| %v2float = OpTypeVector %float 2 |
| %buf1 = OpTypeStruct %v2float |
| %_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1 |
| %x_11 = OpVariable %_ptr_Uniform_buf1 Uniform |
| %v4float = OpTypeVector %float 4 |
| %_ptr_Private_v4float = OpTypePointer Private %v4float |
| %9 = OpConstantNull %v4float |
| %x_GLF_color = OpVariable %_ptr_Private_v4float Private %9 |
| %gl_FragCoord = OpVariable %_ptr_Private_v4float Private %9 |
| %buf0 = OpTypeStruct %v2float |
| %_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0 |
| %x_19 = OpVariable %_ptr_Uniform_buf0 Uniform |
| %_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 %9 |
| %int = OpTypeInt 32 1 |
| %_ptr_Function_v2float = OpTypePointer Function %v2float |
| %18 = OpTypeFunction %int %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float |
| %_ptr_Function_float = OpTypePointer Function %float |
| %29 = OpConstantNull %float |
| %33 = OpConstantNull %v2float |
| %bool = OpTypeBool |
| %_ptr_Function_bool = OpTypePointer Function %bool |
| %42 = OpConstantNull %bool |
| %uint = OpTypeInt 32 0 |
| %uint_0 = OpConstant %uint 0 |
| %uint_1 = OpConstant %uint 1 |
| %float_0 = OpConstant %float 0 |
| %_ptr_Function_int = OpTypePointer Function %int |
| %148 = OpConstantNull %int |
| %int_0 = OpConstant %int 0 |
| %_ptr_Uniform_float = OpTypePointer Uniform %float |
| %float_1 = OpConstant %float 1 |
| %170 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 |
| %int_1 = OpConstant %int 1 |
| %void = OpTypeVoid |
| %244 = OpTypeFunction %void |
| %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float |
| %float_0_699999988 = OpConstant %float 0.699999988 |
| %float_0_300000012 = OpConstant %float 0.300000012 |
| %262 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012 |
| %float_0_5 = OpConstant %float 0.5 |
| %float_0_899999976 = OpConstant %float 0.899999976 |
| %265 = OpConstantComposite %v2float %float_0_5 %float_0_899999976 |
| %float_0_100000001 = OpConstant %float 0.100000001 |
| %float_0_400000006 = OpConstant %float 0.400000006 |
| %268 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006 |
| %285 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1 |
| %286 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1 |
| %main_out = OpTypeStruct %v4float |
| %287 = OpTypeFunction %void %main_out |
| %pointInTriangle_vf2_vf2_vf2_vf2_ = OpFunction %int None %18 |
| %p = OpFunctionParameter %_ptr_Function_v2float |
| %a = OpFunctionParameter %_ptr_Function_v2float |
| %b = OpFunctionParameter %_ptr_Function_v2float |
| %c = OpFunctionParameter %_ptr_Function_v2float |
| %26 = OpLabel |
| %x_78 = OpVariable %_ptr_Function_float Function %29 |
| %x_79 = OpVariable %_ptr_Function_float Function %29 |
| %x_80 = OpVariable %_ptr_Function_float Function %29 |
| %param = OpVariable %_ptr_Function_v2float Function %33 |
| %param_1 = OpVariable %_ptr_Function_v2float Function %33 |
| %param_2 = OpVariable %_ptr_Function_v2float Function %33 |
| %param_3 = OpVariable %_ptr_Function_v2float Function %33 |
| %param_4 = OpVariable %_ptr_Function_v2float Function %33 |
| %param_5 = OpVariable %_ptr_Function_v2float Function %33 |
| %x_147 = OpVariable %_ptr_Function_bool Function %42 |
| %x_203 = OpVariable %_ptr_Function_bool Function %42 |
| %x_148_phi = OpVariable %_ptr_Function_bool Function %42 |
| %x_204_phi = OpVariable %_ptr_Function_bool Function %42 |
| %x_153_phi = OpVariable %_ptr_Function_int Function %148 |
| %x_154 = OpVariable %_ptr_Function_int Function %148 |
| %x_164_phi = OpVariable %_ptr_Function_int Function %148 |
| %x_165 = OpVariable %_ptr_Function_int Function %148 |
| %49 = OpAccessChain %_ptr_Function_float %p %uint_0 |
| %50 = OpLoad %float %49 |
| %52 = OpAccessChain %_ptr_Function_float %a %uint_0 |
| %53 = OpLoad %float %52 |
| %56 = OpAccessChain %_ptr_Function_float %p %uint_1 |
| %57 = OpLoad %float %56 |
| %59 = OpAccessChain %_ptr_Function_float %a %uint_1 |
| %60 = OpLoad %float %59 |
| %62 = OpAccessChain %_ptr_Function_float %b %uint_0 |
| %63 = OpLoad %float %62 |
| %65 = OpAccessChain %_ptr_Function_float %a %uint_0 |
| %66 = OpLoad %float %65 |
| %68 = OpAccessChain %_ptr_Function_float %b %uint_1 |
| %69 = OpLoad %float %68 |
| %71 = OpAccessChain %_ptr_Function_float %a %uint_1 |
| %72 = OpLoad %float %71 |
| %73 = OpFSub %float %50 %53 |
| %74 = OpFSub %float %57 %60 |
| %75 = OpCompositeConstruct %v2float %73 %74 |
| OpStore %param %75 |
| %76 = OpFSub %float %63 %66 |
| %77 = OpFSub %float %69 %72 |
| %78 = OpCompositeConstruct %v2float %76 %77 |
| OpStore %param_1 %78 |
| %79 = OpAccessChain %_ptr_Function_float %param %uint_0 |
| %80 = OpLoad %float %79 |
| %81 = OpAccessChain %_ptr_Function_float %param_1 %uint_1 |
| %82 = OpLoad %float %81 |
| %83 = OpAccessChain %_ptr_Function_float %param_1 %uint_0 |
| %84 = OpLoad %float %83 |
| %85 = OpAccessChain %_ptr_Function_float %param %uint_1 |
| %86 = OpLoad %float %85 |
| %87 = OpFMul %float %80 %82 |
| %88 = OpFMul %float %84 %86 |
| %89 = OpFSub %float %87 %88 |
| OpStore %x_80 %89 |
| %91 = OpAccessChain %_ptr_Function_float %p %uint_0 |
| %92 = OpLoad %float %91 |
| %94 = OpAccessChain %_ptr_Function_float %b %uint_0 |
| %95 = OpLoad %float %94 |
| %97 = OpAccessChain %_ptr_Function_float %p %uint_1 |
| %98 = OpLoad %float %97 |
| %100 = OpAccessChain %_ptr_Function_float %b %uint_1 |
| %101 = OpLoad %float %100 |
| %103 = OpAccessChain %_ptr_Function_float %c %uint_0 |
| %104 = OpLoad %float %103 |
| %106 = OpAccessChain %_ptr_Function_float %b %uint_0 |
| %107 = OpLoad %float %106 |
| %109 = OpAccessChain %_ptr_Function_float %c %uint_1 |
| %110 = OpLoad %float %109 |
| %112 = OpAccessChain %_ptr_Function_float %b %uint_1 |
| %113 = OpLoad %float %112 |
| %114 = OpFSub %float %92 %95 |
| %115 = OpFSub %float %98 %101 |
| %116 = OpCompositeConstruct %v2float %114 %115 |
| OpStore %param_2 %116 |
| %117 = OpFSub %float %104 %107 |
| %118 = OpFSub %float %110 %113 |
| %119 = OpCompositeConstruct %v2float %117 %118 |
| OpStore %param_3 %119 |
| %120 = OpAccessChain %_ptr_Function_float %param_2 %uint_0 |
| %121 = OpLoad %float %120 |
| %122 = OpAccessChain %_ptr_Function_float %param_3 %uint_1 |
| %123 = OpLoad %float %122 |
| %124 = OpAccessChain %_ptr_Function_float %param_3 %uint_0 |
| %125 = OpLoad %float %124 |
| %126 = OpAccessChain %_ptr_Function_float %param_2 %uint_1 |
| %127 = OpLoad %float %126 |
| %128 = OpFMul %float %121 %123 |
| %129 = OpFMul %float %125 %127 |
| %130 = OpFSub %float %128 %129 |
| OpStore %x_79 %130 |
| %132 = OpFOrdLessThan %bool %89 %float_0 |
| OpSelectionMerge %133 None |
| OpBranchConditional %132 %134 %133 |
| %134 = OpLabel |
| %135 = OpFOrdLessThan %bool %130 %float_0 |
| OpBranch %133 |
| %133 = OpLabel |
| %136 = OpPhi %bool %132 %26 %135 %134 |
| OpStore %x_148_phi %136 |
| %137 = OpLogicalNot %bool %136 |
| OpSelectionMerge %138 None |
| OpBranchConditional %137 %139 %138 |
| %139 = OpLabel |
| %140 = OpFOrdGreaterThanEqual %bool %89 %float_0 |
| OpSelectionMerge %141 None |
| OpBranchConditional %140 %142 %141 |
| %142 = OpLabel |
| %143 = OpFOrdGreaterThanEqual %bool %130 %float_0 |
| OpBranch %141 |
| %141 = OpLabel |
| %144 = OpPhi %bool %140 %139 %143 %142 |
| OpStore %x_147 %144 |
| %145 = OpLoad %bool %x_147 |
| OpStore %x_148_phi %145 |
| OpBranch %138 |
| %138 = OpLabel |
| %149 = OpLoad %bool %x_148_phi |
| %150 = OpLogicalNot %bool %149 |
| OpSelectionMerge %151 None |
| OpBranchConditional %150 %152 %151 |
| %152 = OpLabel |
| OpStore %x_153_phi %int_0 |
| OpBranch %154 |
| %154 = OpLabel |
| OpLoopMerge %155 %156 None |
| OpBranch %157 |
| %157 = OpLabel |
| %160 = OpLoad %int %x_153_phi |
| %162 = OpAccessChain %_ptr_Uniform_float %x_11 %uint_0 %uint_1 |
| %163 = OpLoad %float %162 |
| %164 = OpConvertFToS %int %163 |
| %165 = OpSLessThan %bool %160 %164 |
| OpSelectionMerge %166 None |
| OpBranchConditional %165 %167 %168 |
| %167 = OpLabel |
| OpBranch %166 |
| %168 = OpLabel |
| OpBranch %155 |
| %166 = OpLabel |
| OpStore %x_GLF_color %170 |
| OpStore %x_164_phi %int_0 |
| OpBranch %171 |
| %171 = OpLabel |
| OpLoopMerge %172 %173 None |
| OpBranch %174 |
| %174 = OpLabel |
| %176 = OpLoad %int %x_164_phi |
| %177 = OpSLessThan %bool %176 %164 |
| OpSelectionMerge %178 None |
| OpBranchConditional %177 %179 %180 |
| %179 = OpLabel |
| OpBranch %178 |
| %180 = OpLabel |
| OpBranch %172 |
| %178 = OpLabel |
| OpStore %x_GLF_color %170 |
| OpBranch %173 |
| %173 = OpLabel |
| %182 = OpIAdd %int %176 %int_1 |
| OpStore %x_165 %182 |
| %183 = OpLoad %int %x_165 |
| OpStore %x_164_phi %183 |
| OpBranch %171 |
| %172 = OpLabel |
| OpBranch %156 |
| %156 = OpLabel |
| %184 = OpIAdd %int %160 %int_1 |
| OpStore %x_154 %184 |
| %185 = OpLoad %int %x_154 |
| OpStore %x_153_phi %185 |
| OpBranch %154 |
| %155 = OpLabel |
| OpReturnValue %int_0 |
| %151 = OpLabel |
| %187 = OpAccessChain %_ptr_Function_float %p %uint_0 |
| %188 = OpLoad %float %187 |
| %190 = OpAccessChain %_ptr_Function_float %c %uint_0 |
| %191 = OpLoad %float %190 |
| %193 = OpAccessChain %_ptr_Function_float %p %uint_1 |
| %194 = OpLoad %float %193 |
| %196 = OpAccessChain %_ptr_Function_float %c %uint_1 |
| %197 = OpLoad %float %196 |
| %199 = OpAccessChain %_ptr_Function_float %a %uint_0 |
| %200 = OpLoad %float %199 |
| %202 = OpAccessChain %_ptr_Function_float %c %uint_0 |
| %203 = OpLoad %float %202 |
| %205 = OpAccessChain %_ptr_Function_float %a %uint_1 |
| %206 = OpLoad %float %205 |
| %208 = OpAccessChain %_ptr_Function_float %c %uint_1 |
| %209 = OpLoad %float %208 |
| %210 = OpFSub %float %188 %191 |
| %211 = OpFSub %float %194 %197 |
| %212 = OpCompositeConstruct %v2float %210 %211 |
| OpStore %param_4 %212 |
| %213 = OpFSub %float %200 %203 |
| %214 = OpFSub %float %206 %209 |
| %215 = OpCompositeConstruct %v2float %213 %214 |
| OpStore %param_5 %215 |
| %216 = OpAccessChain %_ptr_Function_float %param_4 %uint_0 |
| %217 = OpLoad %float %216 |
| %218 = OpAccessChain %_ptr_Function_float %param_5 %uint_1 |
| %219 = OpLoad %float %218 |
| %220 = OpAccessChain %_ptr_Function_float %param_5 %uint_0 |
| %221 = OpLoad %float %220 |
| %222 = OpAccessChain %_ptr_Function_float %param_4 %uint_1 |
| %223 = OpLoad %float %222 |
| %224 = OpFMul %float %217 %219 |
| %225 = OpFMul %float %221 %223 |
| %226 = OpFSub %float %224 %225 |
| OpStore %x_78 %226 |
| OpSelectionMerge %227 None |
| OpBranchConditional %132 %228 %227 |
| %228 = OpLabel |
| %229 = OpFOrdLessThan %bool %226 %float_0 |
| OpBranch %227 |
| %227 = OpLabel |
| %230 = OpPhi %bool %132 %151 %229 %228 |
| OpStore %x_204_phi %230 |
| %231 = OpLogicalNot %bool %230 |
| OpSelectionMerge %232 None |
| OpBranchConditional %231 %233 %232 |
| %233 = OpLabel |
| %234 = OpFOrdGreaterThanEqual %bool %89 %float_0 |
| OpSelectionMerge %235 None |
| OpBranchConditional %234 %236 %235 |
| %236 = OpLabel |
| %237 = OpFOrdGreaterThanEqual %bool %226 %float_0 |
| OpBranch %235 |
| %235 = OpLabel |
| %238 = OpPhi %bool %234 %233 %237 %236 |
| OpStore %x_203 %238 |
| %239 = OpLoad %bool %x_203 |
| OpStore %x_204_phi %239 |
| OpBranch %232 |
| %232 = OpLabel |
| %240 = OpLoad %bool %x_204_phi |
| %241 = OpLogicalNot %bool %240 |
| OpSelectionMerge %242 None |
| OpBranchConditional %241 %243 %242 |
| %243 = OpLabel |
| OpReturnValue %int_0 |
| %242 = OpLabel |
| OpReturnValue %int_1 |
| OpFunctionEnd |
| %main_1 = OpFunction %void None %244 |
| %247 = OpLabel |
| %param_6 = OpVariable %_ptr_Function_v2float Function %33 |
| %param_7 = OpVariable %_ptr_Function_v2float Function %33 |
| %param_8 = OpVariable %_ptr_Function_v2float Function %33 |
| %param_9 = OpVariable %_ptr_Function_v2float Function %33 |
| %252 = OpLoad %v4float %gl_FragCoord |
| %254 = OpAccessChain %_ptr_Uniform_v2float %x_19 %uint_0 |
| %255 = OpLoad %v2float %254 |
| %256 = OpCompositeExtract %float %252 0 |
| %257 = OpCompositeExtract %float %252 1 |
| %258 = OpCompositeConstruct %v2float %256 %257 |
| %259 = OpFDiv %v2float %258 %255 |
| OpStore %param_6 %259 |
| OpStore %param_7 %262 |
| OpStore %param_8 %265 |
| OpStore %param_9 %268 |
| %269 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9 |
| %274 = OpIEqual %bool %269 %int_1 |
| OpSelectionMerge %275 None |
| OpBranchConditional %274 %276 %277 |
| %276 = OpLabel |
| %278 = OpAccessChain %_ptr_Uniform_float %x_11 %uint_0 %uint_1 |
| %279 = OpLoad %float %278 |
| %280 = OpAccessChain %_ptr_Uniform_float %x_11 %uint_0 %uint_0 |
| %281 = OpLoad %float %280 |
| %282 = OpFOrdGreaterThanEqual %bool %279 %281 |
| OpSelectionMerge %283 None |
| OpBranchConditional %282 %284 %283 |
| %284 = OpLabel |
| OpStore %x_GLF_color %285 |
| OpBranch %283 |
| %283 = OpLabel |
| OpBranch %275 |
| %277 = OpLabel |
| OpStore %x_GLF_color %286 |
| OpBranch %275 |
| %275 = OpLabel |
| OpReturn |
| OpFunctionEnd |
| %tint_symbol_3 = OpFunction %void None %287 |
| %tint_symbol_1 = OpFunctionParameter %main_out |
| %291 = OpLabel |
| %292 = OpCompositeExtract %v4float %tint_symbol_1 0 |
| OpStore %tint_symbol_2 %292 |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %244 |
| %294 = OpLabel |
| %295 = OpLoad %v4float %tint_symbol |
| OpStore %gl_FragCoord %295 |
| %296 = OpFunctionCall %void %main_1 |
| %298 = OpLoad %v4float %x_GLF_color |
| %299 = OpCompositeConstruct %main_out %298 |
| %297 = OpFunctionCall %void %tint_symbol_3 %299 |
| OpReturn |
| OpFunctionEnd |