blob: cbaf95067d7ae309d3616fbf64545631cf037937 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 256
; 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_137 "x_137"
OpName %x_169 "x_169"
OpName %x_138_phi "x_138_phi"
OpName %x_170_phi "x_170_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
%204 = OpTypeFunction %void
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_0_699999988 = OpConstant %float 0.699999988
%float_0_300000012 = OpConstant %float 0.300000012
%224 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012
%float_0_5 = OpConstant %float 0.5
%float_0_899999976 = OpConstant %float 0.899999976
%227 = OpConstantComposite %v2float %float_0_5 %float_0_899999976
%float_0_100000001 = OpConstant %float 0.100000001
%float_0_400000006 = OpConstant %float 0.400000006
%230 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006
%float_1 = OpConstant %float 1
%241 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%242 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%243 = 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_137 = OpVariable %_ptr_Function_bool Function %62
%x_169 = OpVariable %_ptr_Function_bool Function %62
%x_138_phi = OpVariable %_ptr_Function_bool Function %62
%x_170_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
%136 = OpFOrdLessThan %bool %133 %float_0
%137 = OpLogicalAnd %bool %135 %136
OpStore %x_138_phi %137
%138 = OpLogicalNot %bool %137
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %139
%140 = OpLabel
%141 = OpLoad %float %pab
%142 = OpLoad %float %pbc
%143 = OpFOrdGreaterThanEqual %bool %141 %float_0
%144 = OpFOrdGreaterThanEqual %bool %142 %float_0
%145 = OpLogicalAnd %bool %143 %144
OpStore %x_137 %145
%146 = OpLoad %bool %x_137
OpStore %x_138_phi %146
OpBranch %139
%139 = OpLabel
%147 = OpLoad %bool %x_138_phi
%148 = OpLogicalNot %bool %147
OpSelectionMerge %149 None
OpBranchConditional %148 %150 %149
%150 = OpLabel
OpReturnValue %int_0
%149 = OpLabel
%153 = OpAccessChain %_ptr_Function_float %p %uint_0
%154 = OpLoad %float %153
%156 = OpAccessChain %_ptr_Function_float %c %uint_0
%157 = OpLoad %float %156
%159 = OpAccessChain %_ptr_Function_float %p %uint_1
%160 = OpLoad %float %159
%162 = OpAccessChain %_ptr_Function_float %c %uint_1
%163 = OpLoad %float %162
%165 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%166 = OpLoad %float %165
%168 = OpAccessChain %_ptr_Function_float %c %uint_0
%169 = OpLoad %float %168
%171 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%172 = OpLoad %float %171
%174 = OpAccessChain %_ptr_Function_float %c %uint_1
%175 = OpLoad %float %174
%176 = OpFSub %float %154 %157
%177 = OpFSub %float %160 %163
%178 = OpCompositeConstruct %v2float %176 %177
OpStore %param_4 %178
%179 = OpFSub %float %166 %169
%180 = OpFSub %float %172 %175
%181 = OpCompositeConstruct %v2float %179 %180
OpStore %param_5 %181
%182 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_4 %param_5
OpStore %pca %182
%185 = OpLoad %float %pab
%186 = OpLoad %float %pca
%187 = OpFOrdLessThan %bool %185 %float_0
%188 = OpFOrdLessThan %bool %186 %float_0
%189 = OpLogicalAnd %bool %187 %188
OpStore %x_170_phi %189
%190 = OpLogicalNot %bool %189
OpSelectionMerge %191 None
OpBranchConditional %190 %192 %191
%192 = OpLabel
%193 = OpLoad %float %pab
%194 = OpLoad %float %pca
%195 = OpFOrdGreaterThanEqual %bool %193 %float_0
%196 = OpFOrdGreaterThanEqual %bool %194 %float_0
%197 = OpLogicalAnd %bool %195 %196
OpStore %x_169 %197
%198 = OpLoad %bool %x_169
OpStore %x_170_phi %198
OpBranch %191
%191 = OpLabel
%199 = OpLoad %bool %x_170_phi
%200 = OpLogicalNot %bool %199
OpSelectionMerge %201 None
OpBranchConditional %200 %202 %201
%202 = OpLabel
OpReturnValue %int_0
%201 = OpLabel
OpReturnValue %int_1
OpFunctionEnd
%main_1 = OpFunction %void None %204
%207 = 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
%213 = OpLoad %v4float %gl_FragCoord
%215 = OpAccessChain %_ptr_Uniform_v2float %x_24 %uint_0
%216 = OpLoad %v2float %215
%217 = OpCompositeExtract %float %213 0
%218 = OpCompositeExtract %float %213 1
%219 = OpCompositeConstruct %v2float %217 %218
%220 = OpFDiv %v2float %219 %216
OpStore %pos %220
%221 = OpLoad %v2float %pos
OpStore %param_6 %221
OpStore %param_7 %224
OpStore %param_8 %227
OpStore %param_9 %230
%231 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9
%236 = OpIEqual %bool %231 %int_1
OpSelectionMerge %237 None
OpBranchConditional %236 %238 %239
%238 = OpLabel
OpStore %x_GLF_color %241
OpBranch %237
%239 = OpLabel
OpStore %x_GLF_color %242
OpBranch %237
%237 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %243
%tint_symbol_1 = OpFunctionParameter %main_out
%247 = OpLabel
%248 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %248
OpReturn
OpFunctionEnd
%main = OpFunction %void None %204
%250 = OpLabel
%251 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %251
%252 = OpFunctionCall %void %main_1
%254 = OpLoad %v4float %x_GLF_color
%255 = OpCompositeConstruct %main_out %254
%253 = OpFunctionCall %void %tint_symbol_3 %255
OpReturn
OpFunctionEnd