| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 110 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint Fragment %main "main" %main_loc0_Input %main_loc0_Output |
| OpExecutionMode %main OriginUpperLeft |
| OpName %Sampler "Sampler" |
| OpName %randomTexture "randomTexture" |
| OpName %main_loc0_Input "main_loc0_Input" |
| OpName %main_loc0_Output "main_loc0_Output" |
| OpName %main_inner "main_inner" |
| OpName %vUV "vUV" |
| OpName %random "random" |
| OpName %i "i" |
| OpName %tint_loop_idx "tint_loop_idx" |
| OpName %offset "offset" |
| OpName %sampleDepth "sampleDepth" |
| OpName %tint_low_inc "tint_low_inc" |
| OpName %tint_carry "tint_carry" |
| OpName %main "main" |
| OpDecorate %Sampler DescriptorSet 0 |
| OpDecorate %Sampler Binding 0 |
| OpDecorate %randomTexture DescriptorSet 0 |
| OpDecorate %randomTexture Binding 1 |
| OpDecorate %main_loc0_Input Location 0 |
| OpDecorate %main_loc0_Output Location 0 |
| %3 = OpTypeSampler |
| %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 |
| %Sampler = OpVariable %_ptr_UniformConstant_3 UniformConstant |
| %float = OpTypeFloat 32 |
| %6 = OpTypeImage %float 2D 0 0 0 1 Unknown |
| %_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6 |
| %randomTexture = OpVariable %_ptr_UniformConstant_6 UniformConstant |
| %v2float = OpTypeVector %float 2 |
| %_ptr_Input_v2float = OpTypePointer Input %v2float |
| %main_loc0_Input = OpVariable %_ptr_Input_v2float Input |
| %v4float = OpTypeVector %float 4 |
| %_ptr_Output_v4float = OpTypePointer Output %v4float |
| %main_loc0_Output = OpVariable %_ptr_Output_v4float Output |
| %16 = OpTypeFunction %v4float %v2float |
| %21 = OpTypeSampledImage %6 |
| %v3float = OpTypeVector %float 3 |
| %int = OpTypeInt 32 1 |
| %_ptr_Function_int = OpTypePointer Function %int |
| %int_0 = OpConstant %int 0 |
| %float_1 = OpConstant %float 1 |
| %34 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 |
| %uint = OpTypeInt 32 0 |
| %v2uint = OpTypeVector %uint 2 |
| %_ptr_Function_v2uint = OpTypePointer Function %v2uint |
| %uint_4294967295 = OpConstant %uint 4294967295 |
| %40 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295 |
| %44 = OpConstantNull %v2uint |
| %bool = OpTypeBool |
| %v2bool = OpTypeVector %bool 2 |
| %int_1 = OpConstant %int 1 |
| %sampleDepth = OpConstant %float 0 |
| %true = OpConstantTrue %bool |
| %_ptr_Function_uint = OpTypePointer Function %uint |
| %uint_0 = OpConstant %uint 0 |
| %uint_1 = OpConstant %uint 1 |
| %void = OpTypeVoid |
| %106 = OpTypeFunction %void |
| %main_inner = OpFunction %v4float None %16 |
| %vUV = OpFunctionParameter %v2float |
| %17 = OpLabel |
| %i = OpVariable %_ptr_Function_int Function |
| %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function |
| %18 = OpLoad %6 %randomTexture None |
| %19 = OpLoad %3 %Sampler None |
| %20 = OpSampledImage %21 %18 %19 |
| %22 = OpImageSampleImplicitLod %v4float %20 %vUV None |
| %random = OpVectorShuffle %v3float %22 %22 0 1 2 |
| OpStore %i %int_0 |
| OpBranch %29 |
| %29 = OpLabel |
| OpStore %tint_loop_idx %40 |
| OpBranch %32 |
| %32 = OpLabel |
| OpLoopMerge %33 %31 None |
| OpBranch %30 |
| %30 = OpLabel |
| %42 = OpLoad %v2uint %tint_loop_idx None |
| %43 = OpIEqual %v2bool %42 %44 |
| %47 = OpAll %bool %43 |
| OpSelectionMerge %48 None |
| OpBranchConditional %47 %49 %48 |
| %49 = OpLabel |
| OpBranch %33 |
| %48 = OpLabel |
| %50 = OpLoad %int %i None |
| %51 = OpSLessThan %bool %50 %int_1 |
| OpSelectionMerge %53 None |
| OpBranchConditional %51 %53 %54 |
| %54 = OpLabel |
| OpBranch %33 |
| %53 = OpLabel |
| %55 = OpCompositeExtract %float %random 0 |
| %offset = OpCompositeConstruct %v3float %55 %55 %55 |
| %57 = OpCompositeExtract %float %offset 0 |
| %58 = OpFOrdLessThan %bool %57 %sampleDepth |
| OpSelectionMerge %60 None |
| OpBranchConditional %58 %61 %62 |
| %61 = OpLabel |
| OpBranch %60 |
| %62 = OpLabel |
| %96 = OpCompositeExtract %float %offset 1 |
| %65 = OpFOrdLessThan %bool %96 %sampleDepth |
| OpBranch %60 |
| %60 = OpLabel |
| %63 = OpPhi %bool %true %61 %65 %62 |
| OpSelectionMerge %66 None |
| OpBranchConditional %63 %67 %68 |
| %67 = OpLabel |
| OpBranch %66 |
| %68 = OpLabel |
| %97 = OpCompositeExtract %float %offset 0 |
| %70 = OpFOrdGreaterThan %bool %97 %float_1 |
| OpBranch %66 |
| %66 = OpLabel |
| %69 = OpPhi %bool %true %67 %70 %68 |
| OpSelectionMerge %71 None |
| OpBranchConditional %69 %72 %73 |
| %72 = OpLabel |
| OpBranch %71 |
| %73 = OpLabel |
| %98 = OpCompositeExtract %float %offset 1 |
| %75 = OpFOrdGreaterThan %bool %98 %float_1 |
| OpBranch %71 |
| %71 = OpLabel |
| %74 = OpPhi %bool %true %72 %75 %73 |
| OpSelectionMerge %76 None |
| OpBranchConditional %74 %77 %76 |
| %77 = OpLabel |
| %99 = OpLoad %int %i None |
| %100 = OpBitcast %uint %99 |
| %101 = OpBitcast %uint %int_1 |
| %102 = OpIAdd %uint %100 %101 |
| %103 = OpBitcast %int %102 |
| OpStore %i %103 None |
| OpBranch %31 |
| %76 = OpLabel |
| %78 = OpLoad %int %i None |
| %79 = OpBitcast %uint %78 |
| %80 = OpBitcast %uint %int_1 |
| %81 = OpIAdd %uint %79 %80 |
| %82 = OpBitcast %int %81 |
| OpStore %i %82 None |
| OpBranch %31 |
| %31 = OpLabel |
| %83 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0 |
| %86 = OpLoad %uint %83 None |
| %tint_low_inc = OpISub %uint %86 %uint_1 |
| %89 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0 |
| OpStore %89 %tint_low_inc None |
| %90 = OpIEqual %bool %tint_low_inc %uint_4294967295 |
| %tint_carry = OpSelect %uint %90 %uint_1 %uint_0 |
| %92 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1 |
| %93 = OpLoad %uint %92 None |
| %94 = OpISub %uint %93 %tint_carry |
| %95 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1 |
| OpStore %95 %94 None |
| OpBranch %32 |
| %33 = OpLabel |
| OpReturnValue %34 |
| OpFunctionEnd |
| %main = OpFunction %void None %106 |
| %107 = OpLabel |
| %108 = OpLoad %v2float %main_loc0_Input None |
| %109 = OpFunctionCall %v4float %main_inner %108 |
| OpStore %main_loc0_Output %109 None |
| OpReturn |
| OpFunctionEnd |