blob: cf14852dcb0461e9da91d44c4a296a8151c3cba3 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 292
; 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 %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 %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 %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 %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
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
%v2float = OpTypeVector %float 2
%buf1 = OpTypeStruct %v2float
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_11 = OpVariable %_ptr_Uniform_buf1 Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %7
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %7
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_19 = OpVariable %_ptr_Uniform_buf0 Uniform
%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
%144 = OpConstantNull %int
%int_0 = OpConstant %int 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_1 = OpConstant %float 1
%166 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%int_1 = OpConstant %int 1
%void = OpTypeVoid
%236 = OpTypeFunction %void
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_0_699999988 = OpConstant %float 0.699999988
%float_0_300000012 = OpConstant %float 0.300000012
%254 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012
%float_0_5 = OpConstant %float 0.5
%float_0_899999976 = OpConstant %float 0.899999976
%257 = OpConstantComposite %v2float %float_0_5 %float_0_899999976
%float_0_100000001 = OpConstant %float 0.100000001
%float_0_400000006 = OpConstant %float 0.400000006
%260 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006
%277 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%278 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%279 = OpTypeFunction %main_out %v4float
%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 %144
%x_154 = OpVariable %_ptr_Function_int Function %144
%x_164_phi = OpVariable %_ptr_Function_int Function %144
%x_165 = OpVariable %_ptr_Function_int Function %144
%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
%133 = OpFOrdLessThan %bool %130 %float_0
%134 = OpLogicalAnd %bool %132 %133
OpStore %x_148_phi %134
%135 = OpLogicalNot %bool %134
OpSelectionMerge %136 None
OpBranchConditional %135 %137 %136
%137 = OpLabel
%138 = OpFOrdGreaterThanEqual %bool %89 %float_0
%139 = OpFOrdGreaterThanEqual %bool %130 %float_0
%140 = OpLogicalAnd %bool %138 %139
OpStore %x_147 %140
%141 = OpLoad %bool %x_147
OpStore %x_148_phi %141
OpBranch %136
%136 = OpLabel
%145 = OpLoad %bool %x_148_phi
%146 = OpLogicalNot %bool %145
OpSelectionMerge %147 None
OpBranchConditional %146 %148 %147
%148 = OpLabel
OpStore %x_153_phi %int_0
OpBranch %150
%150 = OpLabel
OpLoopMerge %151 %152 None
OpBranch %153
%153 = OpLabel
%156 = OpLoad %int %x_153_phi
%158 = OpAccessChain %_ptr_Uniform_float %x_11 %uint_0 %uint_1
%159 = OpLoad %float %158
%160 = OpConvertFToS %int %159
%161 = OpSLessThan %bool %156 %160
OpSelectionMerge %162 None
OpBranchConditional %161 %163 %164
%163 = OpLabel
OpBranch %162
%164 = OpLabel
OpBranch %151
%162 = OpLabel
OpStore %x_GLF_color %166
OpStore %x_164_phi %int_0
OpBranch %167
%167 = OpLabel
OpLoopMerge %168 %169 None
OpBranch %170
%170 = OpLabel
%172 = OpLoad %int %x_164_phi
%173 = OpSLessThan %bool %172 %160
OpSelectionMerge %174 None
OpBranchConditional %173 %175 %176
%175 = OpLabel
OpBranch %174
%176 = OpLabel
OpBranch %168
%174 = OpLabel
OpStore %x_GLF_color %166
OpBranch %169
%169 = OpLabel
%178 = OpIAdd %int %172 %int_1
OpStore %x_165 %178
%179 = OpLoad %int %x_165
OpStore %x_164_phi %179
OpBranch %167
%168 = OpLabel
OpBranch %152
%152 = OpLabel
%180 = OpIAdd %int %156 %int_1
OpStore %x_154 %180
%181 = OpLoad %int %x_154
OpStore %x_153_phi %181
OpBranch %150
%151 = OpLabel
OpReturnValue %int_0
%147 = OpLabel
%183 = OpAccessChain %_ptr_Function_float %p %uint_0
%184 = OpLoad %float %183
%186 = OpAccessChain %_ptr_Function_float %c %uint_0
%187 = OpLoad %float %186
%189 = OpAccessChain %_ptr_Function_float %p %uint_1
%190 = OpLoad %float %189
%192 = OpAccessChain %_ptr_Function_float %c %uint_1
%193 = OpLoad %float %192
%195 = OpAccessChain %_ptr_Function_float %a %uint_0
%196 = OpLoad %float %195
%198 = OpAccessChain %_ptr_Function_float %c %uint_0
%199 = OpLoad %float %198
%201 = OpAccessChain %_ptr_Function_float %a %uint_1
%202 = OpLoad %float %201
%204 = OpAccessChain %_ptr_Function_float %c %uint_1
%205 = OpLoad %float %204
%206 = OpFSub %float %184 %187
%207 = OpFSub %float %190 %193
%208 = OpCompositeConstruct %v2float %206 %207
OpStore %param_4 %208
%209 = OpFSub %float %196 %199
%210 = OpFSub %float %202 %205
%211 = OpCompositeConstruct %v2float %209 %210
OpStore %param_5 %211
%212 = OpAccessChain %_ptr_Function_float %param_4 %uint_0
%213 = OpLoad %float %212
%214 = OpAccessChain %_ptr_Function_float %param_5 %uint_1
%215 = OpLoad %float %214
%216 = OpAccessChain %_ptr_Function_float %param_5 %uint_0
%217 = OpLoad %float %216
%218 = OpAccessChain %_ptr_Function_float %param_4 %uint_1
%219 = OpLoad %float %218
%220 = OpFMul %float %213 %215
%221 = OpFMul %float %217 %219
%222 = OpFSub %float %220 %221
OpStore %x_78 %222
%223 = OpFOrdLessThan %bool %222 %float_0
%224 = OpLogicalAnd %bool %132 %223
OpStore %x_204_phi %224
%225 = OpLogicalNot %bool %224
OpSelectionMerge %226 None
OpBranchConditional %225 %227 %226
%227 = OpLabel
%228 = OpFOrdGreaterThanEqual %bool %89 %float_0
%229 = OpFOrdGreaterThanEqual %bool %222 %float_0
%230 = OpLogicalAnd %bool %228 %229
OpStore %x_203 %230
%231 = OpLoad %bool %x_203
OpStore %x_204_phi %231
OpBranch %226
%226 = OpLabel
%232 = OpLoad %bool %x_204_phi
%233 = OpLogicalNot %bool %232
OpSelectionMerge %234 None
OpBranchConditional %233 %235 %234
%235 = OpLabel
OpReturnValue %int_0
%234 = OpLabel
OpReturnValue %int_1
OpFunctionEnd
%main_1 = OpFunction %void None %236
%239 = 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
%244 = OpLoad %v4float %gl_FragCoord
%246 = OpAccessChain %_ptr_Uniform_v2float %x_19 %uint_0
%247 = OpLoad %v2float %246
%248 = OpCompositeExtract %float %244 0
%249 = OpCompositeExtract %float %244 1
%250 = OpCompositeConstruct %v2float %248 %249
%251 = OpFDiv %v2float %250 %247
OpStore %param_6 %251
OpStore %param_7 %254
OpStore %param_8 %257
OpStore %param_9 %260
%261 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9
%266 = OpIEqual %bool %261 %int_1
OpSelectionMerge %267 None
OpBranchConditional %266 %268 %269
%268 = OpLabel
%270 = OpAccessChain %_ptr_Uniform_float %x_11 %uint_0 %uint_1
%271 = OpLoad %float %270
%272 = OpAccessChain %_ptr_Uniform_float %x_11 %uint_0 %uint_0
%273 = OpLoad %float %272
%274 = OpFOrdGreaterThanEqual %bool %271 %273
OpSelectionMerge %275 None
OpBranchConditional %274 %276 %275
%276 = OpLabel
OpStore %x_GLF_color %277
OpBranch %275
%275 = OpLabel
OpBranch %267
%269 = OpLabel
OpStore %x_GLF_color %278
OpBranch %267
%267 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %279
%gl_FragCoord_param = OpFunctionParameter %v4float
%283 = OpLabel
OpStore %gl_FragCoord %gl_FragCoord_param
%284 = OpFunctionCall %void %main_1
%285 = OpLoad %v4float %x_GLF_color
%286 = OpCompositeConstruct %main_out %285
OpReturnValue %286
OpFunctionEnd
%main = OpFunction %void None %236
%288 = OpLabel
%290 = OpLoad %v4float %gl_FragCoord_param_1
%289 = OpFunctionCall %main_out %main_inner %290
%291 = OpCompositeExtract %v4float %289 0
OpStore %x_GLF_color_1_1 %291
OpReturn
OpFunctionEnd