blob: a3e66de2162c2882d4f37379de82ef9bbe9ca57e [file] [log] [blame]
bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from uniform control flow
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
bug/tint/948.wgsl:138:9 note: control flow depends on non-uniform value
if ((x_197 > x_198)) {
^^
bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' may result in a non-uniform value
let x_198 : f32 = mt;
^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 383
; Schema: 0
OpCapability Shader
%136 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tUV_param_1 %tileID_1_param_1 %levelUnits_param_1 %stageUnits_1_param_1 %vPosition_param_1 %vUV_param_1 %glFragColor_1_1
OpExecutionMode %main OriginUpperLeft
OpName %tUV_param_1 "tUV_param_1"
OpName %tileID_1_param_1 "tileID_1_param_1"
OpName %levelUnits_param_1 "levelUnits_param_1"
OpName %stageUnits_1_param_1 "stageUnits_1_param_1"
OpName %vPosition_param_1 "vPosition_param_1"
OpName %vUV_param_1 "vUV_param_1"
OpName %glFragColor_1_1 "glFragColor_1_1"
OpName %LeftOver "LeftOver"
OpMemberName %LeftOver 0 "time"
OpMemberName %LeftOver 1 "padding"
OpMemberName %LeftOver 2 "worldViewProjection"
OpMemberName %LeftOver 3 "outputSize"
OpMemberName %LeftOver 4 "stageSize"
OpMemberName %LeftOver 5 "spriteMapSize"
OpMemberName %LeftOver 6 "stageScale"
OpMemberName %LeftOver 7 "spriteCount"
OpMemberName %LeftOver 8 "colorMul"
OpName %x_20 "x_20"
OpName %frameMapTexture "frameMapTexture"
OpName %frameMapSampler "frameMapSampler"
OpName %tUV "tUV"
OpName %tileMapsTexture0 "tileMapsTexture0"
OpName %tileMapsSampler "tileMapsSampler"
OpName %tileMapsTexture1 "tileMapsTexture1"
OpName %animationMapTexture "animationMapTexture"
OpName %animationMapSampler "animationMapSampler"
OpName %mt "mt"
OpName %spriteSheetTexture "spriteSheetTexture"
OpName %spriteSheetSampler "spriteSheetSampler"
OpName %glFragColor "glFragColor"
OpName %tileID_1 "tileID_1"
OpName %levelUnits "levelUnits"
OpName %stageUnits_1 "stageUnits_1"
OpName %vPosition "vPosition"
OpName %vUV "vUV"
OpName %getFrameData_f1_ "getFrameData_f1_"
OpName %frameID "frameID"
OpName %fX "fX"
OpName %main_1 "main_1"
OpName %color "color"
OpName %tileUV "tileUV"
OpName %tileID "tileID"
OpName %sheetUnits "sheetUnits"
OpName %spriteUnits "spriteUnits"
OpName %stageUnits "stageUnits"
OpName %i "i"
OpName %frameID_1 "frameID_1"
OpName %animationData "animationData"
OpName %f "f"
OpName %frameData "frameData"
OpName %param "param"
OpName %frameSize "frameSize"
OpName %offset_1 "offset_1"
OpName %ratio "ratio"
OpName %nc "nc"
OpName %alpha "alpha"
OpName %mixed "mixed"
OpName %main_out "main_out"
OpMemberName %main_out 0 "glFragColor_1"
OpName %main_inner "main_inner"
OpName %tUV_param "tUV_param"
OpName %tileID_1_param "tileID_1_param"
OpName %levelUnits_param "levelUnits_param"
OpName %stageUnits_1_param "stageUnits_1_param"
OpName %vPosition_param "vPosition_param"
OpName %vUV_param "vUV_param"
OpName %main "main"
OpDecorate %tUV_param_1 Location 2
OpDecorate %tileID_1_param_1 Location 5
OpDecorate %levelUnits_param_1 Location 4
OpDecorate %stageUnits_1_param_1 Location 3
OpDecorate %vPosition_param_1 Location 0
OpDecorate %vUV_param_1 Location 1
OpDecorate %glFragColor_1_1 Location 0
OpDecorate %LeftOver Block
OpMemberDecorate %LeftOver 0 Offset 0
OpMemberDecorate %LeftOver 1 Offset 4
OpMemberDecorate %LeftOver 2 Offset 16
OpMemberDecorate %LeftOver 2 ColMajor
OpMemberDecorate %LeftOver 2 MatrixStride 16
OpMemberDecorate %LeftOver 3 Offset 80
OpMemberDecorate %LeftOver 4 Offset 88
OpMemberDecorate %LeftOver 5 Offset 96
OpMemberDecorate %LeftOver 6 Offset 104
OpMemberDecorate %LeftOver 7 Offset 108
OpMemberDecorate %LeftOver 8 Offset 112
OpDecorate %x_20 NonWritable
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 9
OpDecorate %frameMapTexture DescriptorSet 2
OpDecorate %frameMapTexture Binding 3
OpDecorate %frameMapSampler DescriptorSet 2
OpDecorate %frameMapSampler Binding 2
OpDecorate %tileMapsTexture0 DescriptorSet 2
OpDecorate %tileMapsTexture0 Binding 5
OpDecorate %tileMapsSampler DescriptorSet 2
OpDecorate %tileMapsSampler Binding 4
OpDecorate %tileMapsTexture1 DescriptorSet 2
OpDecorate %tileMapsTexture1 Binding 6
OpDecorate %animationMapTexture DescriptorSet 2
OpDecorate %animationMapTexture Binding 8
OpDecorate %animationMapSampler DescriptorSet 2
OpDecorate %animationMapSampler Binding 7
OpDecorate %spriteSheetTexture DescriptorSet 2
OpDecorate %spriteSheetTexture Binding 1
OpDecorate %spriteSheetSampler DescriptorSet 2
OpDecorate %spriteSheetSampler Binding 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Input_v2float = OpTypePointer Input %v2float
%tUV_param_1 = OpVariable %_ptr_Input_v2float Input
%tileID_1_param_1 = OpVariable %_ptr_Input_v2float Input
%levelUnits_param_1 = OpVariable %_ptr_Input_v2float Input
%stageUnits_1_param_1 = OpVariable %_ptr_Input_v2float Input
%v3float = OpTypeVector %float 3
%_ptr_Input_v3float = OpTypePointer Input %v3float
%vPosition_param_1 = OpVariable %_ptr_Input_v3float Input
%vUV_param_1 = OpVariable %_ptr_Input_v2float Input
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%15 = OpConstantNull %v4float
%glFragColor_1_1 = OpVariable %_ptr_Output_v4float Output %15
%uint = OpTypeInt 32 0
%mat4v4float = OpTypeMatrix %v4float 4
%LeftOver = OpTypeStruct %float %uint %mat4v4float %v2float %v2float %v2float %float %float %v3float
%_ptr_Uniform_LeftOver = OpTypePointer Uniform %LeftOver
%x_20 = OpVariable %_ptr_Uniform_LeftOver Uniform
%23 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_23 = OpTypePointer UniformConstant %23
%frameMapTexture = OpVariable %_ptr_UniformConstant_23 UniformConstant
%26 = OpTypeSampler
%_ptr_UniformConstant_26 = OpTypePointer UniformConstant %26
%frameMapSampler = OpVariable %_ptr_UniformConstant_26 UniformConstant
%_ptr_Private_v2float = OpTypePointer Private %v2float
%29 = OpConstantNull %v2float
%tUV = OpVariable %_ptr_Private_v2float Private %29
%tileMapsTexture0 = OpVariable %_ptr_UniformConstant_23 UniformConstant
%tileMapsSampler = OpVariable %_ptr_UniformConstant_26 UniformConstant
%tileMapsTexture1 = OpVariable %_ptr_UniformConstant_23 UniformConstant
%animationMapTexture = OpVariable %_ptr_UniformConstant_23 UniformConstant
%animationMapSampler = OpVariable %_ptr_UniformConstant_26 UniformConstant
%_ptr_Private_float = OpTypePointer Private %float
%37 = OpConstantNull %float
%mt = OpVariable %_ptr_Private_float Private %37
%spriteSheetTexture = OpVariable %_ptr_UniformConstant_23 UniformConstant
%spriteSheetSampler = OpVariable %_ptr_UniformConstant_26 UniformConstant
%_ptr_Private_v4float = OpTypePointer Private %v4float
%glFragColor = OpVariable %_ptr_Private_v4float Private %15
%tileID_1 = OpVariable %_ptr_Private_v2float Private %29
%levelUnits = OpVariable %_ptr_Private_v2float Private %29
%stageUnits_1 = OpVariable %_ptr_Private_v2float Private %29
%_ptr_Private_v3float = OpTypePointer Private %v3float
%47 = OpConstantNull %v3float
%vPosition = OpVariable %_ptr_Private_v3float Private %47
%vUV = OpVariable %_ptr_Private_v2float Private %29
%_ptr_Function_float = OpTypePointer Function %float
%49 = OpTypeFunction %mat4v4float %_ptr_Function_float
%uint_7 = OpConstant %uint 7
%_ptr_Uniform_float = OpTypePointer Uniform %float
%66 = OpTypeSampledImage %23
%float_0_25 = OpConstant %float 0.25
%float_0_5 = OpConstant %float 0.5
%void = OpTypeVoid
%104 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_v2float = OpTypePointer Function %v2float
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%119 = OpConstantNull %int
%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
%125 = OpConstantNull %mat4v4float
%_ptr_Function_v3float = OpTypePointer Function %v3float
%uint_1 = OpConstant %uint 1
%float_1 = OpConstant %float 1
%uint_5 = OpConstant %uint 5
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%149 = OpConstantComposite %v2float %float_1 %float_1
%uint_4 = OpConstant %uint 4
%int_2 = OpConstant %int 2
%bool = OpTypeBool
%181 = OpConstantComposite %v2float %float_0_5 %float_0_5
%uint_0 = OpConstant %uint 0
%uint_2 = OpConstant %uint 2
%float_8 = OpConstant %float 8
%float_0_125 = OpConstant %float 0.125
%uint_3 = OpConstant %uint 3
%int_1 = OpConstant %int 1
%uint_8 = OpConstant %uint 8
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
%main_out = OpTypeStruct %v4float
%360 = OpTypeFunction %main_out %v2float %v2float %v2float %v2float %v3float %v2float
%getFrameData_f1_ = OpFunction %mat4v4float None %49
%frameID = OpFunctionParameter %_ptr_Function_float
%53 = OpLabel
%fX = OpVariable %_ptr_Function_float Function %37
%56 = OpLoad %float %frameID
%59 = OpAccessChain %_ptr_Uniform_float %x_20 %uint_7
%60 = OpLoad %float %59
%61 = OpFDiv %float %56 %60
OpStore %fX %61
%62 = OpLoad %float %fX
%64 = OpLoad %26 %frameMapSampler
%65 = OpLoad %23 %frameMapTexture
%67 = OpSampledImage %66 %65 %64
%68 = OpCompositeConstruct %v2float %62 %37
%63 = OpImageSampleImplicitLod %v4float %67 %68 Bias %37
%69 = OpLoad %float %fX
%71 = OpLoad %26 %frameMapSampler
%72 = OpLoad %23 %frameMapTexture
%73 = OpSampledImage %66 %72 %71
%75 = OpCompositeConstruct %v2float %69 %float_0_25
%70 = OpImageSampleImplicitLod %v4float %73 %75 Bias %37
%76 = OpLoad %float %fX
%78 = OpLoad %26 %frameMapSampler
%79 = OpLoad %23 %frameMapTexture
%80 = OpSampledImage %66 %79 %78
%82 = OpCompositeConstruct %v2float %76 %float_0_5
%77 = OpImageSampleImplicitLod %v4float %80 %82 Bias %37
%83 = OpCompositeExtract %float %63 0
%84 = OpCompositeExtract %float %63 1
%85 = OpCompositeExtract %float %63 2
%86 = OpCompositeExtract %float %63 3
%87 = OpCompositeConstruct %v4float %83 %84 %85 %86
%88 = OpCompositeExtract %float %70 0
%89 = OpCompositeExtract %float %70 1
%90 = OpCompositeExtract %float %70 2
%91 = OpCompositeExtract %float %70 3
%92 = OpCompositeConstruct %v4float %88 %89 %90 %91
%93 = OpCompositeExtract %float %77 0
%94 = OpCompositeExtract %float %77 1
%95 = OpCompositeExtract %float %77 2
%96 = OpCompositeExtract %float %77 3
%97 = OpCompositeConstruct %v4float %93 %94 %95 %96
%98 = OpCompositeExtract %float %15 0
%99 = OpCompositeExtract %float %15 1
%100 = OpCompositeExtract %float %15 2
%101 = OpCompositeExtract %float %15 3
%102 = OpCompositeConstruct %v4float %98 %99 %100 %101
%103 = OpCompositeConstruct %mat4v4float %87 %92 %97 %102
OpReturnValue %103
OpFunctionEnd
%main_1 = OpFunction %void None %104
%107 = OpLabel
%color = OpVariable %_ptr_Function_v4float Function %15
%tileUV = OpVariable %_ptr_Function_v2float Function %29
%tileID = OpVariable %_ptr_Function_v2float Function %29
%sheetUnits = OpVariable %_ptr_Function_v2float Function %29
%spriteUnits = OpVariable %_ptr_Function_float Function %37
%stageUnits = OpVariable %_ptr_Function_v2float Function %29
%i = OpVariable %_ptr_Function_int Function %119
%frameID_1 = OpVariable %_ptr_Function_float Function %37
%animationData = OpVariable %_ptr_Function_v4float Function %15
%f = OpVariable %_ptr_Function_float Function %37
%frameData = OpVariable %_ptr_Function_mat4v4float Function %125
%param = OpVariable %_ptr_Function_float Function %37
%frameSize = OpVariable %_ptr_Function_v2float Function %29
%offset_1 = OpVariable %_ptr_Function_v2float Function %29
%ratio = OpVariable %_ptr_Function_v2float Function %29
%nc = OpVariable %_ptr_Function_v4float Function %15
%alpha = OpVariable %_ptr_Function_float Function %37
%mixed = OpVariable %_ptr_Function_v3float Function %47
OpStore %color %15
%134 = OpLoad %v2float %tUV
%135 = OpExtInst %v2float %136 Fract %134
OpStore %tileUV %135
%138 = OpAccessChain %_ptr_Function_float %tileUV %uint_1
%139 = OpLoad %float %138
%140 = OpAccessChain %_ptr_Function_float %tileUV %uint_1
%142 = OpFSub %float %float_1 %139
OpStore %140 %142
%143 = OpLoad %v2float %tUV
%144 = OpExtInst %v2float %136 Floor %143
OpStore %tileID %144
%147 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_5
%148 = OpLoad %v2float %147
%150 = OpFDiv %v2float %149 %148
OpStore %sheetUnits %150
%151 = OpAccessChain %_ptr_Uniform_float %x_20 %uint_7
%152 = OpLoad %float %151
%153 = OpFDiv %float %float_1 %152
OpStore %spriteUnits %153
%155 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_4
%156 = OpLoad %v2float %155
%157 = OpFDiv %v2float %149 %156
OpStore %stageUnits %157
OpStore %i %119
OpBranch %158
%158 = OpLabel
OpLoopMerge %159 %160 None
OpBranch %161
%161 = OpLabel
%162 = OpLoad %int %i
%164 = OpSLessThan %bool %162 %int_2
OpSelectionMerge %166 None
OpBranchConditional %164 %167 %168
%167 = OpLabel
OpBranch %166
%168 = OpLabel
OpBranch %159
%166 = OpLabel
%169 = OpLoad %int %i
OpSelectionMerge %170 None
OpSwitch %169 %171 1 %172 0 %173
%172 = OpLabel
%174 = OpLoad %v2float %tileID
%175 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_4
%176 = OpLoad %v2float %175
%178 = OpLoad %26 %tileMapsSampler
%179 = OpLoad %23 %tileMapsTexture1
%180 = OpSampledImage %66 %179 %178
%182 = OpFAdd %v2float %174 %181
%183 = OpFDiv %v2float %182 %176
%177 = OpImageSampleImplicitLod %v4float %180 %183 Bias %37
%184 = OpCompositeExtract %float %177 0
OpStore %frameID_1 %184
OpBranch %170
%173 = OpLabel
%185 = OpLoad %v2float %tileID
%186 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_4
%187 = OpLoad %v2float %186
%189 = OpLoad %26 %tileMapsSampler
%190 = OpLoad %23 %tileMapsTexture0
%191 = OpSampledImage %66 %190 %189
%192 = OpFAdd %v2float %185 %181
%193 = OpFDiv %v2float %192 %187
%188 = OpImageSampleImplicitLod %v4float %191 %193 Bias %37
%194 = OpCompositeExtract %float %188 0
OpStore %frameID_1 %194
OpBranch %170
%171 = OpLabel
OpBranch %170
%170 = OpLabel
%195 = OpLoad %float %frameID_1
%196 = OpAccessChain %_ptr_Uniform_float %x_20 %uint_7
%197 = OpLoad %float %196
%199 = OpLoad %26 %animationMapSampler
%200 = OpLoad %23 %animationMapTexture
%201 = OpSampledImage %66 %200 %199
%202 = OpFAdd %float %195 %float_0_5
%203 = OpFDiv %float %202 %197
%204 = OpCompositeConstruct %v2float %203 %37
%198 = OpImageSampleImplicitLod %v4float %201 %204 Bias %37
OpStore %animationData %198
%205 = OpAccessChain %_ptr_Function_float %animationData %uint_1
%206 = OpLoad %float %205
%207 = OpFOrdGreaterThan %bool %206 %37
OpSelectionMerge %208 None
OpBranchConditional %207 %209 %208
%209 = OpLabel
%211 = OpAccessChain %_ptr_Uniform_float %x_20 %uint_0
%212 = OpLoad %float %211
%214 = OpAccessChain %_ptr_Function_float %animationData %uint_2
%215 = OpLoad %float %214
%216 = OpFMul %float %212 %215
%217 = OpFRem %float %216 %float_1
OpStore %mt %217
OpStore %f %37
OpBranch %218
%218 = OpLabel
OpLoopMerge %219 %220 None
OpBranch %221
%221 = OpLabel
%222 = OpLoad %float %f
%224 = OpFOrdLessThan %bool %222 %float_8
OpSelectionMerge %225 None
OpBranchConditional %224 %226 %227
%226 = OpLabel
OpBranch %225
%227 = OpLabel
OpBranch %219
%225 = OpLabel
%228 = OpAccessChain %_ptr_Function_float %animationData %uint_1
%229 = OpLoad %float %228
%230 = OpLoad %float %mt
%231 = OpFOrdGreaterThan %bool %229 %230
OpSelectionMerge %232 None
OpBranchConditional %231 %233 %232
%233 = OpLabel
%234 = OpAccessChain %_ptr_Function_float %animationData %uint_0
%235 = OpLoad %float %234
OpStore %frameID_1 %235
OpBranch %219
%232 = OpLabel
%236 = OpLoad %float %frameID_1
%237 = OpAccessChain %_ptr_Uniform_float %x_20 %uint_7
%238 = OpLoad %float %237
%239 = OpLoad %float %f
%241 = OpLoad %26 %animationMapSampler
%242 = OpLoad %23 %animationMapTexture
%243 = OpSampledImage %66 %242 %241
%244 = OpFAdd %float %236 %float_0_5
%245 = OpFDiv %float %244 %238
%247 = OpFMul %float %float_0_125 %239
%248 = OpCompositeConstruct %v2float %245 %247
%240 = OpImageSampleImplicitLod %v4float %243 %248 Bias %37
OpStore %animationData %240
OpBranch %220
%220 = OpLabel
%249 = OpLoad %float %f
%250 = OpFAdd %float %249 %float_1
OpStore %f %250
OpBranch %218
%219 = OpLabel
OpBranch %208
%208 = OpLabel
%251 = OpLoad %float %frameID_1
%252 = OpFAdd %float %251 %float_0_5
OpStore %param %252
%253 = OpFunctionCall %mat4v4float %getFrameData_f1_ %param
OpStore %frameData %253
%255 = OpAccessChain %_ptr_Function_v4float %frameData %119
%256 = OpLoad %v4float %255
%257 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_5
%258 = OpLoad %v2float %257
%259 = OpCompositeExtract %float %256 3
%260 = OpCompositeExtract %float %256 2
%261 = OpCompositeConstruct %v2float %259 %260
%262 = OpFDiv %v2float %261 %258
OpStore %frameSize %262
%263 = OpAccessChain %_ptr_Function_v4float %frameData %119
%264 = OpLoad %v4float %263
%265 = OpLoad %v2float %sheetUnits
%266 = OpCompositeExtract %float %264 0
%267 = OpCompositeExtract %float %264 1
%268 = OpCompositeConstruct %v2float %266 %267
%269 = OpFMul %v2float %268 %265
OpStore %offset_1 %269
%270 = OpAccessChain %_ptr_Function_v4float %frameData %int_2
%271 = OpLoad %v4float %270
%272 = OpAccessChain %_ptr_Function_v4float %frameData %119
%273 = OpLoad %v4float %272
%274 = OpCompositeExtract %float %271 0
%275 = OpCompositeExtract %float %271 1
%276 = OpCompositeConstruct %v2float %274 %275
%277 = OpCompositeExtract %float %273 3
%278 = OpCompositeExtract %float %273 2
%279 = OpCompositeConstruct %v2float %277 %278
%280 = OpFDiv %v2float %276 %279
OpStore %ratio %280
%281 = OpAccessChain %_ptr_Function_float %frameData %int_2 %uint_2
%282 = OpLoad %float %281
%283 = OpFOrdEqual %bool %282 %float_1
OpSelectionMerge %284 None
OpBranchConditional %283 %285 %284
%285 = OpLabel
%286 = OpLoad %v2float %tileUV
%287 = OpCompositeExtract %float %286 1
%288 = OpCompositeExtract %float %286 0
%289 = OpCompositeConstruct %v2float %287 %288
OpStore %tileUV %289
OpBranch %284
%284 = OpLabel
%290 = OpLoad %int %i
%291 = OpIEqual %bool %290 %119
OpSelectionMerge %292 None
OpBranchConditional %291 %293 %294
%293 = OpLabel
%295 = OpLoad %v2float %tileUV
%296 = OpLoad %v2float %frameSize
%297 = OpLoad %v2float %offset_1
%299 = OpLoad %26 %spriteSheetSampler
%300 = OpLoad %23 %spriteSheetTexture
%301 = OpSampledImage %66 %300 %299
%302 = OpFMul %v2float %295 %296
%303 = OpFAdd %v2float %302 %297
%298 = OpImageSampleImplicitLod %v4float %301 %303
OpStore %color %298
OpBranch %292
%294 = OpLabel
%304 = OpLoad %v2float %tileUV
%305 = OpLoad %v2float %frameSize
%306 = OpLoad %v2float %offset_1
%308 = OpLoad %26 %spriteSheetSampler
%309 = OpLoad %23 %spriteSheetTexture
%310 = OpSampledImage %66 %309 %308
%311 = OpFMul %v2float %304 %305
%312 = OpFAdd %v2float %311 %306
%307 = OpImageSampleImplicitLod %v4float %310 %312
OpStore %nc %307
%314 = OpAccessChain %_ptr_Function_float %color %uint_3
%315 = OpLoad %float %314
%316 = OpAccessChain %_ptr_Function_float %nc %uint_3
%317 = OpLoad %float %316
%319 = OpFAdd %float %315 %317
%318 = OpExtInst %float %136 NMin %319 %float_1
OpStore %alpha %318
%320 = OpLoad %v4float %color
%321 = OpLoad %v4float %nc
%322 = OpAccessChain %_ptr_Function_float %nc %uint_3
%323 = OpLoad %float %322
%325 = OpCompositeExtract %float %320 0
%326 = OpCompositeExtract %float %320 1
%327 = OpCompositeExtract %float %320 2
%328 = OpCompositeConstruct %v3float %325 %326 %327
%329 = OpCompositeExtract %float %321 0
%330 = OpCompositeExtract %float %321 1
%331 = OpCompositeExtract %float %321 2
%332 = OpCompositeConstruct %v3float %329 %330 %331
%333 = OpCompositeConstruct %v3float %323 %323 %323
%324 = OpExtInst %v3float %136 FMix %328 %332 %333
OpStore %mixed %324
%334 = OpLoad %v3float %mixed
%335 = OpLoad %float %alpha
%336 = OpCompositeExtract %float %334 0
%337 = OpCompositeExtract %float %334 1
%338 = OpCompositeExtract %float %334 2
%339 = OpCompositeConstruct %v4float %336 %337 %338 %335
OpStore %color %339
OpBranch %292
%292 = OpLabel
OpBranch %160
%160 = OpLabel
%340 = OpLoad %int %i
%342 = OpIAdd %int %340 %int_1
OpStore %i %342
OpBranch %158
%159 = OpLabel
%345 = OpAccessChain %_ptr_Uniform_v3float %x_20 %uint_8
%346 = OpLoad %v3float %345
%347 = OpLoad %v4float %color
%348 = OpCompositeExtract %float %347 0
%349 = OpCompositeExtract %float %347 1
%350 = OpCompositeExtract %float %347 2
%351 = OpCompositeConstruct %v3float %348 %349 %350
%352 = OpFMul %v3float %351 %346
%353 = OpLoad %v4float %color
%354 = OpCompositeExtract %float %352 0
%355 = OpCompositeExtract %float %352 1
%356 = OpCompositeExtract %float %352 2
%357 = OpCompositeExtract %float %353 3
%358 = OpCompositeConstruct %v4float %354 %355 %356 %357
OpStore %color %358
%359 = OpLoad %v4float %color
OpStore %glFragColor %359
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %360
%tUV_param = OpFunctionParameter %v2float
%tileID_1_param = OpFunctionParameter %v2float
%levelUnits_param = OpFunctionParameter %v2float
%stageUnits_1_param = OpFunctionParameter %v2float
%vPosition_param = OpFunctionParameter %v3float
%vUV_param = OpFunctionParameter %v2float
%369 = OpLabel
OpStore %tUV %tUV_param
OpStore %tileID_1 %tileID_1_param
OpStore %levelUnits %levelUnits_param
OpStore %stageUnits_1 %stageUnits_1_param
OpStore %vPosition %vPosition_param
OpStore %vUV %vUV_param
%370 = OpFunctionCall %void %main_1
%371 = OpLoad %v4float %glFragColor
%372 = OpCompositeConstruct %main_out %371
OpReturnValue %372
OpFunctionEnd
%main = OpFunction %void None %104
%374 = OpLabel
%376 = OpLoad %v2float %tUV_param_1
%377 = OpLoad %v2float %tileID_1_param_1
%378 = OpLoad %v2float %levelUnits_param_1
%379 = OpLoad %v2float %stageUnits_1_param_1
%380 = OpLoad %v3float %vPosition_param_1
%381 = OpLoad %v2float %vUV_param_1
%375 = OpFunctionCall %main_out %main_inner %376 %377 %378 %379 %380 %381
%382 = OpCompositeExtract %v4float %375 0
OpStore %glFragColor_1_1 %382
OpReturn
OpFunctionEnd