blob: 4762c189fcc703c87a5724d48432c63cb3daa16c [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 264
; Schema: 0
OpCapability Shader
%56 = 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_7 "x_7"
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 %main_1 "main_1"
OpName %c "c"
OpName %x_51 "x_51"
OpName %x_55 "x_55"
OpName %x_56 "x_56"
OpName %x_81 "x_81"
OpName %x_82 "x_82"
OpName %x_118 "x_118"
OpName %x_119 "x_119"
OpName %x_55_phi "x_55_phi"
OpName %x_58_phi "x_58_phi"
OpName %x_81_phi "x_81_phi"
OpName %x_82_phi "x_82_phi"
OpName %x_83_phi "x_83_phi"
OpName %x_85_phi "x_85_phi"
OpName %x_122_phi "x_122_phi"
OpName %x_129_phi "x_129_phi"
OpName %x_68 "x_68"
OpName %x_76 "x_76"
OpName %x_59 "x_59"
OpName %x_56_phi "x_56_phi"
OpName %x_75 "x_75"
OpName %x_76_phi "x_76_phi"
OpName %x_88 "x_88"
OpName %x_92 "x_92"
OpName %x_93 "x_93"
OpName %x_92_phi "x_92_phi"
OpName %x_95_phi "x_95_phi"
OpName %x_118_phi "x_118_phi"
OpName %x_119_phi "x_119_phi"
OpName %x_120_phi "x_120_phi"
OpName %x_105 "x_105"
OpName %x_113 "x_113"
OpName %x_96 "x_96"
OpName %x_93_phi "x_93_phi"
OpName %x_112 "x_112"
OpName %x_113_phi "x_113_phi"
OpName %x_130 "x_130"
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_7 NonWritable
OpDecorate %x_7 DescriptorSet 0
OpDecorate %x_7 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_7 = 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
%void = OpTypeVoid
%15 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%22 = OpConstantNull %v3float
%_ptr_Function_float = OpTypePointer Function %float
%25 = OpConstantNull %float
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%36 = OpConstantNull %int
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%42 = OpConstantNull %bool
%float_7 = OpConstant %float 7
%float_8 = OpConstant %float 8
%float_9 = OpConstant %float 9
%49 = OpConstantComposite %v3float %float_7 %float_8 %float_9
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_0_125 = OpConstant %float 0.125
%_ptr_Private_float = OpTypePointer Private %float
%float_n0_5 = OpConstant %float -0.5
%int_1 = OpConstant %int 1
%float_0 = OpConstant %float 0
%false = OpConstantFalse %bool
%int_800 = OpConstant %int 800
%int_32 = OpConstant %int 32
%int_0 = OpConstant %int 0
%float_0_400000006 = OpConstant %float 0.400000006
%float_0_00999999978 = OpConstant %float 0.00999999978
%float_100 = OpConstant %float 100
%true = OpConstantTrue %bool
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%int_3 = OpConstant %int 3
%float_1 = OpConstant %float 1
%main_out = OpTypeStruct %v4float
%251 = OpTypeFunction %void %main_out
%main_1 = OpFunction %void None %15
%18 = OpLabel
%c = OpVariable %_ptr_Function_v3float Function %22
%x_51 = OpVariable %_ptr_Function_float Function %25
%x_55 = OpVariable %_ptr_Function_float Function %25
%x_56 = OpVariable %_ptr_Function_float Function %25
%x_81 = OpVariable %_ptr_Function_float Function %25
%x_82 = OpVariable %_ptr_Function_float Function %25
%x_118 = OpVariable %_ptr_Function_float Function %25
%x_119 = OpVariable %_ptr_Function_float Function %25
%x_55_phi = OpVariable %_ptr_Function_float Function %25
%x_58_phi = OpVariable %_ptr_Function_int Function %36
%x_81_phi = OpVariable %_ptr_Function_float Function %25
%x_82_phi = OpVariable %_ptr_Function_float Function %25
%x_83_phi = OpVariable %_ptr_Function_bool Function %42
%x_85_phi = OpVariable %_ptr_Function_float Function %25
%x_122_phi = OpVariable %_ptr_Function_float Function %25
%x_129_phi = OpVariable %_ptr_Function_int Function %36
%x_68 = OpVariable %_ptr_Function_float Function %25
%x_76 = OpVariable %_ptr_Function_float Function %25
%x_59 = OpVariable %_ptr_Function_int Function %36
%x_56_phi = OpVariable %_ptr_Function_float Function %25
%x_75 = OpVariable %_ptr_Function_float Function %25
%x_76_phi = OpVariable %_ptr_Function_float Function %25
%x_88 = OpVariable %_ptr_Function_float Function %25
%x_92 = OpVariable %_ptr_Function_float Function %25
%x_93 = OpVariable %_ptr_Function_float Function %25
%x_92_phi = OpVariable %_ptr_Function_float Function %25
%x_95_phi = OpVariable %_ptr_Function_int Function %36
%x_118_phi = OpVariable %_ptr_Function_float Function %25
%x_119_phi = OpVariable %_ptr_Function_float Function %25
%x_120_phi = OpVariable %_ptr_Function_bool Function %42
%x_105 = OpVariable %_ptr_Function_float Function %25
%x_113 = OpVariable %_ptr_Function_float Function %25
%x_96 = OpVariable %_ptr_Function_int Function %36
%x_93_phi = OpVariable %_ptr_Function_float Function %25
%x_112 = OpVariable %_ptr_Function_float Function %25
%x_113_phi = OpVariable %_ptr_Function_float Function %25
%x_130 = OpVariable %_ptr_Function_int Function %36
OpStore %c %49
%53 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %uint_0
%54 = OpLoad %float %53
%58 = OpFMul %float %54 %float_0_125
%55 = OpExtInst %float %56 RoundEven %58
%60 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%61 = OpLoad %float %60
OpStore %x_51 %61
OpSelectionMerge %62 None
OpSwitch %uint_0 %63
%63 = OpLabel
OpStore %x_55_phi %float_n0_5
OpStore %x_58_phi %int_1
OpBranch %66
%66 = OpLabel
OpLoopMerge %67 %68 None
OpBranch %69
%69 = OpLabel
%74 = OpLoad %float %x_55_phi
OpStore %x_55 %74
%75 = OpLoad %int %x_58_phi
OpStore %x_81_phi %float_0
%77 = OpLoad %float %x_55
OpStore %x_82_phi %77
OpStore %x_83_phi %false
%80 = OpSLessThan %bool %75 %int_800
OpSelectionMerge %81 None
OpBranchConditional %80 %82 %83
%82 = OpLabel
OpBranch %81
%83 = OpLabel
OpBranch %67
%81 = OpLabel
%87 = OpSMod %int %75 %int_32
%89 = OpIEqual %bool %87 %int_0
OpSelectionMerge %90 None
OpBranchConditional %89 %91 %92
%91 = OpLabel
%93 = OpLoad %float %x_55
%95 = OpFAdd %float %93 %float_0_400000006
OpStore %x_68 %95
%96 = OpLoad %float %x_68
OpStore %x_56_phi %96
OpBranch %90
%92 = OpLabel
%97 = OpLoad %float %x_55
OpStore %x_76_phi %97
%98 = OpConvertSToF %float %75
%99 = OpExtInst %float %56 RoundEven %55
%101 = OpConvertSToF %float %75
%102 = OpExtInst %float %56 RoundEven %55
%103 = OpFDiv %float %101 %102
%100 = OpExtInst %float %56 Floor %103
%104 = OpFMul %float %99 %100
%105 = OpFSub %float %98 %104
%107 = OpFOrdLessThanEqual %bool %105 %float_0_00999999978
OpSelectionMerge %108 None
OpBranchConditional %107 %109 %108
%109 = OpLabel
%110 = OpLoad %float %x_55
%112 = OpFAdd %float %110 %float_100
OpStore %x_75 %112
%113 = OpLoad %float %x_75
OpStore %x_76_phi %113
OpBranch %108
%108 = OpLabel
%114 = OpLoad %float %x_76_phi
OpStore %x_76 %114
%115 = OpLoad %float %x_76
OpStore %x_56_phi %115
OpBranch %90
%90 = OpLabel
%116 = OpLoad %float %x_56_phi
OpStore %x_56 %116
%117 = OpConvertSToF %float %75
%118 = OpLoad %float %x_51
%119 = OpFOrdGreaterThanEqual %bool %117 %118
OpSelectionMerge %120 None
OpBranchConditional %119 %121 %120
%121 = OpLabel
%122 = OpLoad %float %x_56
OpStore %x_81_phi %122
%123 = OpLoad %float %x_56
OpStore %x_82_phi %123
OpStore %x_83_phi %true
OpBranch %67
%120 = OpLabel
OpBranch %68
%68 = OpLabel
%125 = OpIAdd %int %75 %int_1
OpStore %x_59 %125
%126 = OpLoad %float %x_56
OpStore %x_55_phi %126
%127 = OpLoad %int %x_59
OpStore %x_58_phi %127
OpBranch %66
%67 = OpLabel
%128 = OpLoad %float %x_81_phi
OpStore %x_81 %128
%129 = OpLoad %float %x_82_phi
OpStore %x_82 %129
%130 = OpLoad %bool %x_83_phi
%131 = OpLoad %float %x_81
OpStore %x_85_phi %131
OpSelectionMerge %132 None
OpBranchConditional %130 %133 %132
%133 = OpLabel
OpBranch %62
%132 = OpLabel
%134 = OpLoad %float %x_82
OpStore %x_85_phi %134
OpBranch %62
%62 = OpLabel
%143 = OpLoad %float %x_85_phi
%144 = OpAccessChain %_ptr_Function_float %c %uint_0
OpStore %144 %143
%146 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%147 = OpLoad %float %146
OpStore %x_88 %147
OpSelectionMerge %148 None
OpSwitch %uint_0 %149
%149 = OpLabel
OpStore %x_92_phi %float_n0_5
OpStore %x_95_phi %int_1
OpBranch %150
%150 = OpLabel
OpLoopMerge %151 %152 None
OpBranch %153
%153 = OpLabel
%158 = OpLoad %float %x_92_phi
OpStore %x_92 %158
%159 = OpLoad %int %x_95_phi
OpStore %x_118_phi %float_0
%160 = OpLoad %float %x_92
OpStore %x_119_phi %160
OpStore %x_120_phi %false
%161 = OpSLessThan %bool %159 %int_800
OpSelectionMerge %162 None
OpBranchConditional %161 %163 %164
%163 = OpLabel
OpBranch %162
%164 = OpLabel
OpBranch %151
%162 = OpLabel
%167 = OpSMod %int %159 %int_32
%168 = OpIEqual %bool %167 %int_0
OpSelectionMerge %169 None
OpBranchConditional %168 %170 %171
%170 = OpLabel
%172 = OpLoad %float %x_92
%173 = OpFAdd %float %172 %float_0_400000006
OpStore %x_105 %173
%174 = OpLoad %float %x_105
OpStore %x_93_phi %174
OpBranch %169
%171 = OpLabel
%175 = OpLoad %float %x_92
OpStore %x_113_phi %175
%176 = OpConvertSToF %float %159
%177 = OpExtInst %float %56 RoundEven %55
%179 = OpConvertSToF %float %159
%180 = OpExtInst %float %56 RoundEven %55
%181 = OpFDiv %float %179 %180
%178 = OpExtInst %float %56 Floor %181
%182 = OpFMul %float %177 %178
%183 = OpFSub %float %176 %182
%184 = OpFOrdLessThanEqual %bool %183 %float_0_00999999978
OpSelectionMerge %185 None
OpBranchConditional %184 %186 %185
%186 = OpLabel
%187 = OpLoad %float %x_92
%188 = OpFAdd %float %187 %float_100
OpStore %x_112 %188
%189 = OpLoad %float %x_112
OpStore %x_113_phi %189
OpBranch %185
%185 = OpLabel
%190 = OpLoad %float %x_113_phi
OpStore %x_113 %190
%191 = OpLoad %float %x_113
OpStore %x_93_phi %191
OpBranch %169
%169 = OpLabel
%192 = OpLoad %float %x_93_phi
OpStore %x_93 %192
%193 = OpConvertSToF %float %159
%194 = OpLoad %float %x_88
%195 = OpFOrdGreaterThanEqual %bool %193 %194
OpSelectionMerge %196 None
OpBranchConditional %195 %197 %196
%197 = OpLabel
%198 = OpLoad %float %x_93
OpStore %x_118_phi %198
%199 = OpLoad %float %x_93
OpStore %x_119_phi %199
OpStore %x_120_phi %true
OpBranch %151
%196 = OpLabel
OpBranch %152
%152 = OpLabel
%200 = OpIAdd %int %159 %int_1
OpStore %x_96 %200
%201 = OpLoad %float %x_93
OpStore %x_92_phi %201
%202 = OpLoad %int %x_96
OpStore %x_95_phi %202
OpBranch %150
%151 = OpLabel
%203 = OpLoad %float %x_118_phi
OpStore %x_118 %203
%204 = OpLoad %float %x_119_phi
OpStore %x_119 %204
%205 = OpLoad %bool %x_120_phi
%206 = OpLoad %float %x_118
OpStore %x_122_phi %206
OpSelectionMerge %207 None
OpBranchConditional %205 %208 %207
%208 = OpLabel
OpBranch %148
%207 = OpLabel
%209 = OpLoad %float %x_119
OpStore %x_122_phi %209
OpBranch %148
%148 = OpLabel
%210 = OpLoad %float %x_122_phi
%211 = OpAccessChain %_ptr_Function_float %c %uint_1
OpStore %211 %210
%212 = OpAccessChain %_ptr_Function_float %c %uint_0
%213 = OpLoad %float %212
%214 = OpAccessChain %_ptr_Function_float %c %uint_1
%215 = OpLoad %float %214
%217 = OpAccessChain %_ptr_Function_float %c %uint_2
%218 = OpFAdd %float %213 %215
OpStore %217 %218
OpStore %x_129_phi %int_0
OpBranch %219
%219 = OpLabel
OpLoopMerge %220 %221 None
OpBranch %222
%222 = OpLabel
%224 = OpLoad %int %x_129_phi
%226 = OpSLessThan %bool %224 %int_3
OpSelectionMerge %227 None
OpBranchConditional %226 %228 %229
%228 = OpLabel
OpBranch %227
%229 = OpLabel
OpBranch %220
%227 = OpLabel
%230 = OpAccessChain %_ptr_Function_float %c %224
%231 = OpLoad %float %230
%233 = OpFOrdGreaterThanEqual %bool %231 %float_1
OpSelectionMerge %234 None
OpBranchConditional %233 %235 %234
%235 = OpLabel
%236 = OpAccessChain %_ptr_Function_float %c %224
%237 = OpLoad %float %236
%238 = OpAccessChain %_ptr_Function_float %c %224
%239 = OpLoad %float %238
%240 = OpAccessChain %_ptr_Function_float %c %224
%241 = OpFMul %float %237 %239
OpStore %240 %241
OpBranch %234
%234 = OpLabel
OpBranch %221
%221 = OpLabel
%242 = OpIAdd %int %224 %int_1
OpStore %x_130 %242
%243 = OpLoad %int %x_130
OpStore %x_129_phi %243
OpBranch %219
%220 = OpLabel
%244 = OpLoad %v3float %c
%246 = OpExtInst %v3float %56 FAbs %244
%245 = OpExtInst %v3float %56 Normalize %246
%247 = OpCompositeExtract %float %245 0
%248 = OpCompositeExtract %float %245 1
%249 = OpCompositeExtract %float %245 2
%250 = OpCompositeConstruct %v4float %247 %248 %249 %float_1
OpStore %x_GLF_color %250
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %251
%tint_symbol_1 = OpFunctionParameter %main_out
%255 = OpLabel
%256 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %256
OpReturn
OpFunctionEnd
%main = OpFunction %void None %15
%258 = OpLabel
%259 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %259
%260 = OpFunctionCall %void %main_1
%262 = OpLoad %v4float %x_GLF_color
%263 = OpCompositeConstruct %main_out %262
%261 = OpFunctionCall %void %tint_symbol_3 %263
OpReturn
OpFunctionEnd