blob: fd2f1dc845f765ab46332c9e0254606a8e003458 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 298
; Schema: 0
OpCapability Shader
%97 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %buf0 "buf0"
OpMemberName %buf0 0 "resolution"
OpName %x_15 "x_15"
OpName %gl_FragCoord "gl_FragCoord"
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 %var_y "var_y"
OpName %x_96 "x_96"
OpName %x_97 "x_97"
OpName %clamp_y "clamp_y"
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_173 "x_173"
OpName %x_205 "x_205"
OpName %x_174_phi "x_174_phi"
OpName %x_206_phi "x_206_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_15 NonWritable
OpDecorate %x_15 DescriptorSet 0
OpDecorate %x_15 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
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_15 = OpVariable %_ptr_Uniform_buf0 Uniform
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%9 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %9
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %9
%_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
%_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
%55 = OpConstantNull %v2float
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%66 = OpConstantNull %bool
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_0 = OpConstant %float 0
%true = OpConstantTrue %bool
%float_1 = OpConstant %float 1
%float_n1 = OpConstant %float -1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%void = OpTypeVoid
%247 = OpTypeFunction %void
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_0_699999988 = OpConstant %float 0.699999988
%float_0_300000012 = OpConstant %float 0.300000012
%267 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012
%float_0_5 = OpConstant %float 0.5
%float_0_899999976 = OpConstant %float 0.899999976
%270 = OpConstantComposite %v2float %float_0_5 %float_0_899999976
%float_0_100000001 = OpConstant %float 0.100000001
%float_0_400000006 = OpConstant %float 0.400000006
%273 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006
%283 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%284 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%285 = 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
%var_y = OpVariable %_ptr_Function_float Function %49
%x_96 = OpVariable %_ptr_Function_float Function %49
%x_97 = OpVariable %_ptr_Function_float Function %49
%clamp_y = OpVariable %_ptr_Function_float Function %49
%pab = OpVariable %_ptr_Function_float Function %49
%param = OpVariable %_ptr_Function_v2float Function %55
%param_1 = OpVariable %_ptr_Function_v2float Function %55
%pbc = OpVariable %_ptr_Function_float Function %49
%param_2 = OpVariable %_ptr_Function_v2float Function %55
%param_3 = OpVariable %_ptr_Function_v2float Function %55
%pca = OpVariable %_ptr_Function_float Function %49
%param_4 = OpVariable %_ptr_Function_v2float Function %55
%param_5 = OpVariable %_ptr_Function_v2float Function %55
%x_173 = OpVariable %_ptr_Function_bool Function %66
%x_205 = OpVariable %_ptr_Function_bool Function %66
%x_174_phi = OpVariable %_ptr_Function_bool Function %66
%x_206_phi = OpVariable %_ptr_Function_bool Function %66
%71 = OpAccessChain %_ptr_Uniform_float %x_15 %uint_0 %uint_0
%72 = OpLoad %float %71
%73 = OpAccessChain %_ptr_Uniform_float %x_15 %uint_0 %uint_1
%74 = OpLoad %float %73
%75 = OpFOrdEqual %bool %72 %74
OpSelectionMerge %76 None
OpBranchConditional %75 %77 %78
%77 = OpLabel
%80 = OpAccessChain %_ptr_Function_float %c %uint_1
%81 = OpLoad %float %80
%83 = OpCompositeConstruct %v2float %float_0 %81
OpSelectionMerge %85 None
OpBranchConditional %true %86 %87
%86 = OpLabel
%89 = OpAccessChain %_ptr_Function_float %c %uint_1
%90 = OpLoad %float %89
OpStore %x_97 %90
OpBranch %85
%87 = OpLabel
OpStore %x_97 %float_1
OpBranch %85
%85 = OpLabel
%92 = OpLoad %float %x_97
%94 = OpAccessChain %_ptr_Function_float %c %uint_1
%95 = OpLoad %float %94
%96 = OpExtInst %float %97 NMax %92 %95
%98 = OpCompositeConstruct %v2float %float_1 %96
%99 = OpCompositeExtract %float %83 0
%100 = OpCompositeExtract %float %83 1
%101 = OpCompositeConstruct %v2float %99 %100
OpStore %x_96 %81
OpBranch %76
%78 = OpLabel
OpStore %x_96 %float_n1
OpBranch %76
%76 = OpLabel
%103 = OpLoad %float %x_96
OpStore %var_y %103
%105 = OpAccessChain %_ptr_Function_float %c %uint_1
%106 = OpLoad %float %105
%108 = OpAccessChain %_ptr_Function_float %c %uint_1
%109 = OpLoad %float %108
%110 = OpLoad %float %var_y
%111 = OpExtInst %float %97 NClamp %106 %109 %110
OpStore %clamp_y %111
%113 = OpAccessChain %_ptr_Function_float %p %uint_0
%114 = OpLoad %float %113
%116 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%117 = OpLoad %float %116
%119 = OpAccessChain %_ptr_Function_float %p %uint_1
%120 = OpLoad %float %119
%122 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%123 = OpLoad %float %122
%125 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%126 = OpLoad %float %125
%128 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%129 = OpLoad %float %128
%131 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%132 = OpLoad %float %131
%134 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%135 = OpLoad %float %134
%136 = OpFSub %float %114 %117
%137 = OpFSub %float %120 %123
%138 = OpCompositeConstruct %v2float %136 %137
OpStore %param %138
%139 = OpFSub %float %126 %129
%140 = OpFSub %float %132 %135
%141 = OpCompositeConstruct %v2float %139 %140
OpStore %param_1 %141
%142 = OpFunctionCall %float %cross2d_vf2_vf2_ %param %param_1
OpStore %pab %142
%146 = OpAccessChain %_ptr_Function_float %p %uint_0
%147 = OpLoad %float %146
%149 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%150 = OpLoad %float %149
%152 = OpAccessChain %_ptr_Function_float %p %uint_1
%153 = OpLoad %float %152
%155 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%156 = OpLoad %float %155
%158 = OpAccessChain %_ptr_Function_float %c %uint_0
%159 = OpLoad %float %158
%161 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%162 = OpLoad %float %161
%163 = OpLoad %float %clamp_y
%165 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%166 = OpLoad %float %165
%167 = OpFSub %float %147 %150
%168 = OpFSub %float %153 %156
%169 = OpCompositeConstruct %v2float %167 %168
OpStore %param_2 %169
%170 = OpFSub %float %159 %162
%171 = OpFSub %float %163 %166
%172 = OpCompositeConstruct %v2float %170 %171
OpStore %param_3 %172
%173 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_2 %param_3
OpStore %pbc %173
%176 = OpLoad %float %pab
%177 = OpLoad %float %pbc
%178 = OpFOrdLessThan %bool %176 %float_0
%179 = OpFOrdLessThan %bool %177 %float_0
%180 = OpLogicalAnd %bool %178 %179
OpStore %x_174_phi %180
%181 = OpLogicalNot %bool %180
OpSelectionMerge %182 None
OpBranchConditional %181 %183 %182
%183 = OpLabel
%184 = OpLoad %float %pab
%185 = OpLoad %float %pbc
%186 = OpFOrdGreaterThanEqual %bool %184 %float_0
%187 = OpFOrdGreaterThanEqual %bool %185 %float_0
%188 = OpLogicalAnd %bool %186 %187
OpStore %x_173 %188
%189 = OpLoad %bool %x_173
OpStore %x_174_phi %189
OpBranch %182
%182 = OpLabel
%190 = OpLoad %bool %x_174_phi
%191 = OpLogicalNot %bool %190
OpSelectionMerge %192 None
OpBranchConditional %191 %193 %192
%193 = OpLabel
OpReturnValue %int_0
%192 = OpLabel
%196 = OpAccessChain %_ptr_Function_float %p %uint_0
%197 = OpLoad %float %196
%199 = OpAccessChain %_ptr_Function_float %c %uint_0
%200 = OpLoad %float %199
%202 = OpAccessChain %_ptr_Function_float %p %uint_1
%203 = OpLoad %float %202
%205 = OpAccessChain %_ptr_Function_float %c %uint_1
%206 = OpLoad %float %205
%208 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%209 = OpLoad %float %208
%211 = OpAccessChain %_ptr_Function_float %c %uint_0
%212 = OpLoad %float %211
%214 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%215 = OpLoad %float %214
%217 = OpAccessChain %_ptr_Function_float %c %uint_1
%218 = OpLoad %float %217
%219 = OpFSub %float %197 %200
%220 = OpFSub %float %203 %206
%221 = OpCompositeConstruct %v2float %219 %220
OpStore %param_4 %221
%222 = OpFSub %float %209 %212
%223 = OpFSub %float %215 %218
%224 = OpCompositeConstruct %v2float %222 %223
OpStore %param_5 %224
%225 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_4 %param_5
OpStore %pca %225
%228 = OpLoad %float %pab
%229 = OpLoad %float %pca
%230 = OpFOrdLessThan %bool %228 %float_0
%231 = OpFOrdLessThan %bool %229 %float_0
%232 = OpLogicalAnd %bool %230 %231
OpStore %x_206_phi %232
%233 = OpLogicalNot %bool %232
OpSelectionMerge %234 None
OpBranchConditional %233 %235 %234
%235 = OpLabel
%236 = OpLoad %float %pab
%237 = OpLoad %float %pca
%238 = OpFOrdGreaterThanEqual %bool %236 %float_0
%239 = OpFOrdGreaterThanEqual %bool %237 %float_0
%240 = OpLogicalAnd %bool %238 %239
OpStore %x_205 %240
%241 = OpLoad %bool %x_205
OpStore %x_206_phi %241
OpBranch %234
%234 = OpLabel
%242 = OpLoad %bool %x_206_phi
%243 = OpLogicalNot %bool %242
OpSelectionMerge %244 None
OpBranchConditional %243 %245 %244
%245 = OpLabel
OpReturnValue %int_0
%244 = OpLabel
OpReturnValue %int_1
OpFunctionEnd
%main_1 = OpFunction %void None %247
%250 = OpLabel
%pos = OpVariable %_ptr_Function_v2float Function %55
%param_6 = OpVariable %_ptr_Function_v2float Function %55
%param_7 = OpVariable %_ptr_Function_v2float Function %55
%param_8 = OpVariable %_ptr_Function_v2float Function %55
%param_9 = OpVariable %_ptr_Function_v2float Function %55
%256 = OpLoad %v4float %gl_FragCoord
%258 = OpAccessChain %_ptr_Uniform_v2float %x_15 %uint_0
%259 = OpLoad %v2float %258
%260 = OpCompositeExtract %float %256 0
%261 = OpCompositeExtract %float %256 1
%262 = OpCompositeConstruct %v2float %260 %261
%263 = OpFDiv %v2float %262 %259
OpStore %pos %263
%264 = OpLoad %v2float %pos
OpStore %param_6 %264
OpStore %param_7 %267
OpStore %param_8 %270
OpStore %param_9 %273
%274 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9
%279 = OpIEqual %bool %274 %int_1
OpSelectionMerge %280 None
OpBranchConditional %279 %281 %282
%281 = OpLabel
OpStore %x_GLF_color %283
OpBranch %280
%282 = OpLabel
OpStore %x_GLF_color %284
OpBranch %280
%280 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %285
%tint_symbol_1 = OpFunctionParameter %main_out
%289 = OpLabel
%290 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %290
OpReturn
OpFunctionEnd
%main = OpFunction %void None %247
%292 = OpLabel
%293 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %293
%294 = OpFunctionCall %void %main_1
%296 = OpLoad %v4float %x_GLF_color
%297 = OpCompositeConstruct %main_out %296
%295 = OpFunctionCall %void %tint_symbol_3 %297
OpReturn
OpFunctionEnd