blob: 75d9c10c031ad62f7cee0adc2bbc1898c2e2ca1b [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 247
; 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 %buf1 "buf1"
OpMemberName %buf1 0 "resolution"
OpName %x_9 "x_9"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "injectionSwitch"
OpName %x_13 "x_13"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %checkSwap_f1_f1_ "checkSwap_f1_f1_"
OpName %a "a"
OpName %b "b"
OpName %x_147 "x_147"
OpName %x_158 "x_158"
OpName %x_159 "x_159"
OpName %x_179 "x_179"
OpName %x_178 "x_178"
OpName %x_185 "x_185"
OpName %x_184 "x_184"
OpName %x_160_phi "x_160_phi"
OpName %x_180_phi "x_180_phi"
OpName %x_186_phi "x_186_phi"
OpName %x_166 "x_166"
OpName %x_167 "x_167"
OpName %x_168_phi "x_168_phi"
OpName %guard155 "guard155"
OpName %main_1 "main_1"
OpName %i "i"
OpName %data "data"
OpName %i_1 "i_1"
OpName %j "j"
OpName %doSwap "doSwap"
OpName %param "param"
OpName %param_1 "param_1"
OpName %temp "temp"
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 %buf1 Block
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %x_9 NonWritable
OpDecorate %x_9 DescriptorSet 0
OpDecorate %x_9 Binding 1
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_13 NonWritable
OpDecorate %x_13 DescriptorSet 0
OpDecorate %x_13 Binding 0
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpDecorate %_arr_float_uint_10 ArrayStride 4
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
%buf1 = OpTypeStruct %v2float
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_9 = OpVariable %_ptr_Uniform_buf1 Uniform
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_13 = 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
%bool = OpTypeBool
%_ptr_Function_float = OpTypePointer Function %float
%18 = OpTypeFunction %bool %_ptr_Function_float %_ptr_Function_float
%_ptr_Function_bool = OpTypePointer Function %bool
%27 = OpConstantNull %bool
%29 = OpConstantNull %float
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Private_float = OpTypePointer Private %float
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_2 = OpConstant %float 2
%float_0 = OpConstant %float 0
%true = OpConstantTrue %bool
%false = OpConstantFalse %bool
%void = OpTypeVoid
%109 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%116 = OpConstantNull %int
%uint_10 = OpConstant %uint 10
%_arr_float_uint_10 = OpTypeArray %float %uint_10
%_ptr_Function__arr_float_uint_10 = OpTypePointer Function %_arr_float_uint_10
%121 = OpConstantNull %_arr_float_uint_10
%int_0 = OpConstant %int 0
%int_10 = OpConstant %int 10
%int_1 = OpConstant %int 1
%int_9 = OpConstant %int 9
%int_5 = OpConstant %int 5
%float_10 = OpConstant %float 10
%float_1 = OpConstant %float 1
%main_out = OpTypeStruct %v4float
%234 = OpTypeFunction %void %main_out
%checkSwap_f1_f1_ = OpFunction %bool None %18
%a = OpFunctionParameter %_ptr_Function_float
%b = OpFunctionParameter %_ptr_Function_float
%24 = OpLabel
%x_147 = OpVariable %_ptr_Function_bool Function %27
%x_158 = OpVariable %_ptr_Function_float Function %29
%x_159 = OpVariable %_ptr_Function_float Function %29
%x_179 = OpVariable %_ptr_Function_float Function %29
%x_178 = OpVariable %_ptr_Function_float Function %29
%x_185 = OpVariable %_ptr_Function_float Function %29
%x_184 = OpVariable %_ptr_Function_float Function %29
%x_160_phi = OpVariable %_ptr_Function_float Function %29
%x_180_phi = OpVariable %_ptr_Function_float Function %29
%x_186_phi = OpVariable %_ptr_Function_float Function %29
%x_166 = OpVariable %_ptr_Function_float Function %29
%x_167 = OpVariable %_ptr_Function_float Function %29
%x_168_phi = OpVariable %_ptr_Function_float Function %29
%guard155 = OpVariable %_ptr_Function_bool Function %27
%41 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%42 = OpLoad %float %41
%45 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %uint_1
%46 = OpLoad %float %45
%48 = OpFDiv %float %46 %float_2
%49 = OpFOrdLessThan %bool %42 %48
OpSelectionMerge %50 None
OpBranchConditional %49 %51 %52
%51 = OpLabel
%54 = OpLoad %float %a
OpStore %x_158 %54
%55 = OpLoad %float %x_158
OpStore %x_160_phi %55
OpBranch %50
%52 = OpLabel
OpStore %x_159 %float_0
%57 = OpLoad %float %x_159
OpStore %x_160_phi %57
OpBranch %50
%50 = OpLabel
%61 = OpLoad %float %x_160_phi
OpStore %guard155 %true
OpSelectionMerge %65 None
OpBranchConditional %false %66 %67
%66 = OpLabel
OpBranch %65
%67 = OpLabel
%68 = OpLoad %bool %guard155
OpSelectionMerge %69 None
OpBranchConditional %68 %70 %69
%70 = OpLabel
OpSelectionMerge %71 None
OpBranchConditional %49 %72 %73
%72 = OpLabel
%75 = OpLoad %float %b
OpStore %x_166 %75
%76 = OpLoad %float %x_166
OpStore %x_168_phi %76
OpBranch %71
%73 = OpLabel
OpStore %x_167 %float_0
%77 = OpLoad %float %x_167
OpStore %x_168_phi %77
OpBranch %71
%71 = OpLabel
%78 = OpLoad %float %x_168_phi
%79 = OpFOrdGreaterThan %bool %61 %78
OpSelectionMerge %80 None
OpBranchConditional %49 %81 %80
%81 = OpLabel
OpStore %x_147 %79
OpBranch %80
%80 = OpLabel
OpSelectionMerge %82 None
OpBranchConditional %true %83 %84
%83 = OpLabel
OpBranch %82
%84 = OpLabel
OpStore %guard155 %false
OpBranch %82
%82 = OpLabel
%85 = OpLoad %bool %guard155
OpSelectionMerge %86 None
OpBranchConditional %85 %87 %86
%87 = OpLabel
OpStore %guard155 %false
OpBranch %86
%86 = OpLabel
OpBranch %69
%69 = OpLabel
OpBranch %65
%65 = OpLabel
OpSelectionMerge %88 None
OpBranchConditional %49 %89 %90
%89 = OpLabel
OpStore %x_179 %float_0
%91 = OpLoad %float %x_179
OpStore %x_180_phi %91
OpBranch %88
%90 = OpLabel
%93 = OpLoad %float %a
OpStore %x_178 %93
%94 = OpLoad %float %x_178
OpStore %x_180_phi %94
OpBranch %88
%88 = OpLabel
%95 = OpLoad %float %x_180_phi
OpSelectionMerge %96 None
OpBranchConditional %49 %97 %98
%97 = OpLabel
OpStore %x_185 %float_0
%99 = OpLoad %float %x_185
OpStore %x_186_phi %99
OpBranch %96
%98 = OpLabel
%101 = OpLoad %float %b
OpStore %x_184 %101
%102 = OpLoad %float %x_184
OpStore %x_186_phi %102
OpBranch %96
%96 = OpLabel
%103 = OpLoad %float %x_186_phi
OpSelectionMerge %104 None
OpBranchConditional %49 %105 %106
%105 = OpLabel
OpBranch %104
%106 = OpLabel
%107 = OpFOrdLessThan %bool %95 %103
OpStore %x_147 %107
OpBranch %104
%104 = OpLabel
%108 = OpLoad %bool %x_147
OpReturnValue %108
OpFunctionEnd
%main_1 = OpFunction %void None %109
%112 = OpLabel
%i = OpVariable %_ptr_Function_int Function %116
%data = OpVariable %_ptr_Function__arr_float_uint_10 Function %121
%i_1 = OpVariable %_ptr_Function_int Function %116
%j = OpVariable %_ptr_Function_int Function %116
%doSwap = OpVariable %_ptr_Function_bool Function %27
%param = OpVariable %_ptr_Function_float Function %29
%param_1 = OpVariable %_ptr_Function_float Function %29
%temp = OpVariable %_ptr_Function_float Function %29
OpStore %i %int_0
OpBranch %129
%129 = OpLabel
OpLoopMerge %130 %131 None
OpBranch %132
%132 = OpLabel
%133 = OpLoad %int %i
%135 = OpSLessThan %bool %133 %int_10
OpSelectionMerge %136 None
OpBranchConditional %135 %137 %138
%137 = OpLabel
OpBranch %136
%138 = OpLabel
OpBranch %130
%136 = OpLabel
%139 = OpLoad %int %i
%140 = OpLoad %int %i
%141 = OpAccessChain %_ptr_Uniform_float %x_13 %uint_0 %uint_1
%142 = OpLoad %float %141
%143 = OpAccessChain %_ptr_Function_float %data %139
%145 = OpISub %int %int_10 %140
%144 = OpConvertSToF %float %145
%146 = OpFMul %float %144 %142
OpStore %143 %146
OpBranch %131
%131 = OpLabel
%147 = OpLoad %int %i
%149 = OpIAdd %int %147 %int_1
OpStore %i %149
OpBranch %129
%130 = OpLabel
OpStore %i_1 %int_0
OpBranch %150
%150 = OpLabel
OpLoopMerge %151 %152 None
OpBranch %153
%153 = OpLabel
%154 = OpLoad %int %i_1
%156 = OpSLessThan %bool %154 %int_9
OpSelectionMerge %157 None
OpBranchConditional %156 %158 %159
%158 = OpLabel
OpBranch %157
%159 = OpLabel
OpBranch %151
%157 = OpLabel
OpStore %j %int_0
OpBranch %160
%160 = OpLabel
OpLoopMerge %161 %162 None
OpBranch %163
%163 = OpLabel
%164 = OpLoad %int %j
%165 = OpSLessThan %bool %164 %int_10
OpSelectionMerge %166 None
OpBranchConditional %165 %167 %168
%167 = OpLabel
OpBranch %166
%168 = OpLabel
OpBranch %161
%166 = OpLabel
%169 = OpLoad %int %j
%170 = OpLoad %int %i_1
%171 = OpIAdd %int %170 %int_1
%172 = OpSLessThan %bool %169 %171
OpSelectionMerge %173 None
OpBranchConditional %172 %174 %173
%174 = OpLabel
OpBranch %162
%173 = OpLabel
%175 = OpLoad %int %i_1
%176 = OpLoad %int %j
%177 = OpAccessChain %_ptr_Function_float %data %175
%178 = OpLoad %float %177
OpStore %param %178
%179 = OpAccessChain %_ptr_Function_float %data %176
%180 = OpLoad %float %179
OpStore %param_1 %180
%181 = OpFunctionCall %bool %checkSwap_f1_f1_ %param %param_1
OpStore %doSwap %181
%184 = OpLoad %bool %doSwap
OpSelectionMerge %185 None
OpBranchConditional %184 %186 %185
%186 = OpLabel
%187 = OpLoad %int %i_1
%188 = OpAccessChain %_ptr_Function_float %data %187
%189 = OpLoad %float %188
OpStore %temp %189
%190 = OpLoad %int %i_1
%191 = OpLoad %int %j
%192 = OpAccessChain %_ptr_Function_float %data %191
%193 = OpLoad %float %192
%194 = OpAccessChain %_ptr_Function_float %data %190
OpStore %194 %193
%195 = OpLoad %int %j
%196 = OpLoad %float %temp
%197 = OpAccessChain %_ptr_Function_float %data %195
OpStore %197 %196
OpBranch %185
%185 = OpLabel
OpBranch %162
%162 = OpLabel
%198 = OpLoad %int %j
%199 = OpIAdd %int %198 %int_1
OpStore %j %199
OpBranch %160
%161 = OpLabel
OpBranch %152
%152 = OpLabel
%200 = OpLoad %int %i_1
%201 = OpIAdd %int %200 %int_1
OpStore %i_1 %201
OpBranch %150
%151 = OpLabel
%202 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%203 = OpLoad %float %202
%204 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %uint_0
%205 = OpLoad %float %204
%206 = OpFDiv %float %205 %float_2
%207 = OpFOrdLessThan %bool %203 %206
OpSelectionMerge %208 None
OpBranchConditional %207 %209 %210
%209 = OpLabel
%211 = OpAccessChain %_ptr_Function_float %data %int_0
%212 = OpLoad %float %211
%214 = OpAccessChain %_ptr_Function_float %data %int_5
%215 = OpLoad %float %214
%216 = OpAccessChain %_ptr_Function_float %data %int_9
%217 = OpLoad %float %216
%219 = OpFDiv %float %212 %float_10
%220 = OpFDiv %float %215 %float_10
%221 = OpFDiv %float %217 %float_10
%223 = OpCompositeConstruct %v4float %219 %220 %221 %float_1
OpStore %x_GLF_color %223
OpBranch %208
%210 = OpLabel
%224 = OpAccessChain %_ptr_Function_float %data %int_5
%225 = OpLoad %float %224
%226 = OpAccessChain %_ptr_Function_float %data %int_9
%227 = OpLoad %float %226
%228 = OpAccessChain %_ptr_Function_float %data %int_0
%229 = OpLoad %float %228
%230 = OpFDiv %float %225 %float_10
%231 = OpFDiv %float %227 %float_10
%232 = OpFDiv %float %229 %float_10
%233 = OpCompositeConstruct %v4float %230 %231 %232 %float_1
OpStore %x_GLF_color %233
OpBranch %208
%208 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %234
%tint_symbol_1 = OpFunctionParameter %main_out
%238 = OpLabel
%239 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %239
OpReturn
OpFunctionEnd
%main = OpFunction %void None %109
%241 = OpLabel
%242 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %242
%243 = OpFunctionCall %void %main_1
%245 = OpLoad %v4float %x_GLF_color
%246 = OpCompositeConstruct %main_out %245
%244 = OpFunctionCall %void %tint_symbol_3 %246
OpReturn
OpFunctionEnd