blob: d0770bae4f2174515f2b2ac7921df78e4840ae22 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 254
; 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_113 "x_113"
OpName %x_112 "x_112"
OpName %x_96 "x_96"
OpName %x_93_phi "x_93_phi"
OpName %x_111 "x_111"
OpName %x_112_phi "x_112_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
%241 = 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_113 = OpVariable %_ptr_Function_float Function %25
%x_112 = OpVariable %_ptr_Function_float Function %25
%x_96 = OpVariable %_ptr_Function_int Function %36
%x_93_phi = OpVariable %_ptr_Function_float Function %25
%x_111 = OpVariable %_ptr_Function_float Function %25
%x_112_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
%100 = OpFRem %float %98 %99
%102 = OpFOrdLessThanEqual %bool %100 %float_0_00999999978
OpSelectionMerge %103 None
OpBranchConditional %102 %104 %103
%104 = OpLabel
%105 = OpLoad %float %x_55
%107 = OpFAdd %float %105 %float_100
OpStore %x_75 %107
%108 = OpLoad %float %x_75
OpStore %x_76_phi %108
OpBranch %103
%103 = OpLabel
%109 = OpLoad %float %x_76_phi
OpStore %x_76 %109
%110 = OpLoad %float %x_76
OpStore %x_56_phi %110
OpBranch %90
%90 = OpLabel
%111 = OpLoad %float %x_56_phi
OpStore %x_56 %111
%112 = OpConvertSToF %float %75
%113 = OpLoad %float %x_51
%114 = OpFOrdGreaterThanEqual %bool %112 %113
OpSelectionMerge %115 None
OpBranchConditional %114 %116 %115
%116 = OpLabel
%117 = OpLoad %float %x_56
OpStore %x_81_phi %117
%118 = OpLoad %float %x_56
OpStore %x_82_phi %118
OpStore %x_83_phi %true
OpBranch %67
%115 = OpLabel
OpBranch %68
%68 = OpLabel
%120 = OpIAdd %int %75 %int_1
OpStore %x_59 %120
%121 = OpLoad %float %x_56
OpStore %x_55_phi %121
%122 = OpLoad %int %x_59
OpStore %x_58_phi %122
OpBranch %66
%67 = OpLabel
%123 = OpLoad %float %x_81_phi
OpStore %x_81 %123
%124 = OpLoad %float %x_82_phi
OpStore %x_82 %124
%125 = OpLoad %bool %x_83_phi
%126 = OpLoad %float %x_81
OpStore %x_85_phi %126
OpSelectionMerge %127 None
OpBranchConditional %125 %128 %127
%128 = OpLabel
OpBranch %62
%127 = OpLabel
%129 = OpLoad %float %x_82
OpStore %x_85_phi %129
OpBranch %62
%62 = OpLabel
%138 = OpLoad %float %x_85_phi
%139 = OpAccessChain %_ptr_Function_float %c %uint_0
OpStore %139 %138
%141 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%142 = OpLoad %float %141
OpStore %x_88 %142
OpSelectionMerge %143 None
OpSwitch %uint_0 %144
%144 = OpLabel
OpStore %x_92_phi %float_n0_5
OpStore %x_95_phi %int_1
OpBranch %145
%145 = OpLabel
OpLoopMerge %146 %147 None
OpBranch %148
%148 = OpLabel
%153 = OpLoad %float %x_92_phi
OpStore %x_92 %153
%154 = OpLoad %int %x_95_phi
OpStore %x_118_phi %float_0
%155 = OpLoad %float %x_92
OpStore %x_119_phi %155
OpStore %x_120_phi %false
%156 = OpSLessThan %bool %154 %int_800
OpSelectionMerge %157 None
OpBranchConditional %156 %158 %159
%158 = OpLabel
OpBranch %157
%159 = OpLabel
OpBranch %146
%157 = OpLabel
%162 = OpSMod %int %154 %int_32
%163 = OpIEqual %bool %162 %int_0
OpSelectionMerge %164 None
OpBranchConditional %163 %165 %166
%165 = OpLabel
%167 = OpLoad %float %x_92
%168 = OpFAdd %float %167 %float_0_400000006
OpStore %x_113 %168
%169 = OpLoad %float %x_113
OpStore %x_93_phi %169
OpBranch %164
%166 = OpLabel
%170 = OpLoad %float %x_92
OpStore %x_112_phi %170
%171 = OpConvertSToF %float %154
%172 = OpExtInst %float %56 RoundEven %55
%173 = OpFRem %float %171 %172
%174 = OpFOrdLessThanEqual %bool %173 %float_0_00999999978
OpSelectionMerge %175 None
OpBranchConditional %174 %176 %175
%176 = OpLabel
%177 = OpLoad %float %x_92
%178 = OpFAdd %float %177 %float_100
OpStore %x_111 %178
%179 = OpLoad %float %x_111
OpStore %x_112_phi %179
OpBranch %175
%175 = OpLabel
%180 = OpLoad %float %x_112_phi
OpStore %x_112 %180
%181 = OpLoad %float %x_112
OpStore %x_93_phi %181
OpBranch %164
%164 = OpLabel
%182 = OpLoad %float %x_93_phi
OpStore %x_93 %182
%183 = OpConvertSToF %float %154
%184 = OpLoad %float %x_88
%185 = OpFOrdGreaterThanEqual %bool %183 %184
OpSelectionMerge %186 None
OpBranchConditional %185 %187 %186
%187 = OpLabel
%188 = OpLoad %float %x_93
OpStore %x_118_phi %188
%189 = OpLoad %float %x_93
OpStore %x_119_phi %189
OpStore %x_120_phi %true
OpBranch %146
%186 = OpLabel
OpBranch %147
%147 = OpLabel
%190 = OpIAdd %int %154 %int_1
OpStore %x_96 %190
%191 = OpLoad %float %x_93
OpStore %x_92_phi %191
%192 = OpLoad %int %x_96
OpStore %x_95_phi %192
OpBranch %145
%146 = OpLabel
%193 = OpLoad %float %x_118_phi
OpStore %x_118 %193
%194 = OpLoad %float %x_119_phi
OpStore %x_119 %194
%195 = OpLoad %bool %x_120_phi
%196 = OpLoad %float %x_118
OpStore %x_122_phi %196
OpSelectionMerge %197 None
OpBranchConditional %195 %198 %197
%198 = OpLabel
OpBranch %143
%197 = OpLabel
%199 = OpLoad %float %x_119
OpStore %x_122_phi %199
OpBranch %143
%143 = OpLabel
%200 = OpLoad %float %x_122_phi
%201 = OpAccessChain %_ptr_Function_float %c %uint_1
OpStore %201 %200
%202 = OpAccessChain %_ptr_Function_float %c %uint_0
%203 = OpLoad %float %202
%204 = OpAccessChain %_ptr_Function_float %c %uint_1
%205 = OpLoad %float %204
%207 = OpAccessChain %_ptr_Function_float %c %uint_2
%208 = OpFAdd %float %203 %205
OpStore %207 %208
OpStore %x_129_phi %int_0
OpBranch %209
%209 = OpLabel
OpLoopMerge %210 %211 None
OpBranch %212
%212 = OpLabel
%214 = OpLoad %int %x_129_phi
%216 = OpSLessThan %bool %214 %int_3
OpSelectionMerge %217 None
OpBranchConditional %216 %218 %219
%218 = OpLabel
OpBranch %217
%219 = OpLabel
OpBranch %210
%217 = OpLabel
%220 = OpAccessChain %_ptr_Function_float %c %214
%221 = OpLoad %float %220
%223 = OpFOrdGreaterThanEqual %bool %221 %float_1
OpSelectionMerge %224 None
OpBranchConditional %223 %225 %224
%225 = OpLabel
%226 = OpAccessChain %_ptr_Function_float %c %214
%227 = OpLoad %float %226
%228 = OpAccessChain %_ptr_Function_float %c %214
%229 = OpLoad %float %228
%230 = OpAccessChain %_ptr_Function_float %c %214
%231 = OpFMul %float %227 %229
OpStore %230 %231
OpBranch %224
%224 = OpLabel
OpBranch %211
%211 = OpLabel
%232 = OpIAdd %int %214 %int_1
OpStore %x_130 %232
%233 = OpLoad %int %x_130
OpStore %x_129_phi %233
OpBranch %209
%210 = OpLabel
%234 = OpLoad %v3float %c
%236 = OpExtInst %v3float %56 FAbs %234
%235 = OpExtInst %v3float %56 Normalize %236
%237 = OpCompositeExtract %float %235 0
%238 = OpCompositeExtract %float %235 1
%239 = OpCompositeExtract %float %235 2
%240 = OpCompositeConstruct %v4float %237 %238 %239 %float_1
OpStore %x_GLF_color %240
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %241
%tint_symbol_1 = OpFunctionParameter %main_out
%245 = OpLabel
%246 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %246
OpReturn
OpFunctionEnd
%main = OpFunction %void None %15
%248 = OpLabel
%249 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %249
%250 = OpFunctionCall %void %main_1
%252 = OpLoad %v4float %x_GLF_color
%253 = OpCompositeConstruct %main_out %252
%251 = OpFunctionCall %void %tint_symbol_3 %253
OpReturn
OpFunctionEnd