| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 205 |
| ; Schema: 0 |
| OpCapability Shader |
| OpCapability ImageQuery |
| %25 = OpExtInstImport "GLSL.std.450" |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %main "main" %GlobalInvocationID_1 |
| OpExecutionMode %main LocalSize 1 1 1 |
| OpName %GlobalInvocationID_1 "GlobalInvocationID_1" |
| OpName %src "src" |
| OpName %dst "dst" |
| OpName %OutputBuf "OutputBuf" |
| OpMemberName %OutputBuf 0 "result" |
| OpName %output "output" |
| OpName %Uniforms "Uniforms" |
| OpMemberName %Uniforms 0 "dstTextureFlipY" |
| OpMemberName %Uniforms 1 "channelCount" |
| OpMemberName %Uniforms 2 "srcCopyOrigin" |
| OpMemberName %Uniforms 3 "dstCopyOrigin" |
| OpMemberName %Uniforms 4 "copySize" |
| OpName %uniforms "uniforms" |
| OpName %aboutEqual "aboutEqual" |
| OpName %value "value" |
| OpName %expect "expect" |
| OpName %main_inner "main_inner" |
| OpName %GlobalInvocationID "GlobalInvocationID" |
| OpName %success "success" |
| OpName %srcTexCoord "srcTexCoord" |
| OpName %tint_symbol_1 "tint_symbol_1" |
| OpName %tint_symbol "tint_symbol" |
| OpName %tint_symbol_5 "tint_symbol_5" |
| OpName %tint_symbol_4 "tint_symbol_4" |
| OpName %tint_symbol_3 "tint_symbol_3" |
| OpName %tint_symbol_2 "tint_symbol_2" |
| OpName %main "main" |
| OpDecorate %GlobalInvocationID_1 BuiltIn GlobalInvocationId |
| OpDecorate %src DescriptorSet 0 |
| OpDecorate %src Binding 0 |
| OpDecorate %dst DescriptorSet 0 |
| OpDecorate %dst Binding 1 |
| OpDecorate %OutputBuf Block |
| OpMemberDecorate %OutputBuf 0 Offset 0 |
| OpDecorate %_runtimearr_uint ArrayStride 4 |
| OpDecorate %output DescriptorSet 0 |
| OpDecorate %output Binding 2 |
| OpDecorate %Uniforms Block |
| OpMemberDecorate %Uniforms 0 Offset 0 |
| OpMemberDecorate %Uniforms 1 Offset 4 |
| OpMemberDecorate %Uniforms 2 Offset 8 |
| OpMemberDecorate %Uniforms 3 Offset 16 |
| OpMemberDecorate %Uniforms 4 Offset 24 |
| OpDecorate %uniforms NonWritable |
| OpDecorate %uniforms DescriptorSet 0 |
| OpDecorate %uniforms Binding 3 |
| %uint = OpTypeInt 32 0 |
| %v3uint = OpTypeVector %uint 3 |
| %_ptr_Input_v3uint = OpTypePointer Input %v3uint |
| %GlobalInvocationID_1 = OpVariable %_ptr_Input_v3uint Input |
| %float = OpTypeFloat 32 |
| %7 = OpTypeImage %float 2D 0 0 0 1 Unknown |
| %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 |
| %src = OpVariable %_ptr_UniformConstant_7 UniformConstant |
| %dst = OpVariable %_ptr_UniformConstant_7 UniformConstant |
| %_runtimearr_uint = OpTypeRuntimeArray %uint |
| %OutputBuf = OpTypeStruct %_runtimearr_uint |
| %_ptr_StorageBuffer_OutputBuf = OpTypePointer StorageBuffer %OutputBuf |
| %output = OpVariable %_ptr_StorageBuffer_OutputBuf StorageBuffer |
| %v2uint = OpTypeVector %uint 2 |
| %Uniforms = OpTypeStruct %uint %uint %v2uint %v2uint %v2uint |
| %_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms |
| %uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform |
| %bool = OpTypeBool |
| %18 = OpTypeFunction %bool %float %float |
| %float_0_00100000005 = OpConstant %float 0.00100000005 |
| %void = OpTypeVoid |
| %29 = OpTypeFunction %void %v3uint |
| %int = OpTypeInt 32 1 |
| %int_0 = OpConstant %int 0 |
| %v4float = OpTypeVector %float 4 |
| %43 = OpConstantNull %float |
| %float_1 = OpConstant %float 1 |
| %45 = OpConstantComposite %v4float %43 %float_1 %43 %float_1 |
| %true = OpConstantTrue %bool |
| %_ptr_Function_bool = OpTypePointer Function %bool |
| %49 = OpConstantNull %bool |
| %uint_3 = OpConstant %uint 3 |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_Uniform_uint = OpTypePointer Uniform %uint |
| %uint_1 = OpConstant %uint 1 |
| %uint_4 = OpConstant %uint 4 |
| %v2int = OpTypeVector %int 2 |
| %97 = OpConstantNull %int |
| %v4bool = OpTypeVector %bool 4 |
| %_ptr_Uniform_v2uint = OpTypePointer Uniform %v2uint |
| %uint_2 = OpConstant %uint 2 |
| %_ptr_Function_v2uint = OpTypePointer Function %v2uint |
| %111 = OpConstantNull %v2uint |
| %_ptr_Function_uint = OpTypePointer Function %uint |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint |
| %199 = OpConstantNull %uint |
| %200 = OpTypeFunction %void |
| %aboutEqual = OpFunction %bool None %18 |
| %value = OpFunctionParameter %float |
| %expect = OpFunctionParameter %float |
| %23 = OpLabel |
| %26 = OpFSub %float %value %expect |
| %24 = OpExtInst %float %25 FAbs %26 |
| %28 = OpFOrdLessThan %bool %24 %float_0_00100000005 |
| OpReturnValue %28 |
| OpFunctionEnd |
| %main_inner = OpFunction %void None %29 |
| %GlobalInvocationID = OpFunctionParameter %v3uint |
| %33 = OpLabel |
| %success = OpVariable %_ptr_Function_bool Function %49 |
| %srcTexCoord = OpVariable %_ptr_Function_v2uint Function %111 |
| %tint_symbol_1 = OpVariable %_ptr_Function_bool Function %49 |
| %tint_symbol = OpVariable %_ptr_Function_bool Function %49 |
| %tint_symbol_5 = OpVariable %_ptr_Function_bool Function %49 |
| %tint_symbol_4 = OpVariable %_ptr_Function_bool Function %49 |
| %tint_symbol_3 = OpVariable %_ptr_Function_bool Function %49 |
| %tint_symbol_2 = OpVariable %_ptr_Function_bool Function %49 |
| %35 = OpLoad %7 %src |
| %34 = OpImageQuerySizeLod %v2uint %35 %int_0 |
| %39 = OpLoad %7 %dst |
| %38 = OpImageQuerySizeLod %v2uint %39 %int_0 |
| %41 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1 |
| OpStore %success %true |
| %50 = OpCompositeExtract %uint %41 0 |
| %54 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_0 |
| %55 = OpLoad %uint %54 |
| %56 = OpULessThan %bool %50 %55 |
| OpSelectionMerge %57 None |
| OpBranchConditional %56 %57 %58 |
| %58 = OpLabel |
| %59 = OpCompositeExtract %uint %41 1 |
| %61 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_1 |
| %62 = OpLoad %uint %61 |
| %63 = OpULessThan %bool %59 %62 |
| OpBranch %57 |
| %57 = OpLabel |
| %64 = OpPhi %bool %56 %33 %63 %58 |
| OpSelectionMerge %65 None |
| OpBranchConditional %64 %65 %66 |
| %66 = OpLabel |
| %67 = OpCompositeExtract %uint %41 0 |
| %68 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_0 |
| %69 = OpLoad %uint %68 |
| %71 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_4 %uint_0 |
| %72 = OpLoad %uint %71 |
| %73 = OpIAdd %uint %69 %72 |
| %74 = OpUGreaterThanEqual %bool %67 %73 |
| OpBranch %65 |
| %65 = OpLabel |
| %75 = OpPhi %bool %64 %57 %74 %66 |
| OpSelectionMerge %76 None |
| OpBranchConditional %75 %76 %77 |
| %77 = OpLabel |
| %78 = OpCompositeExtract %uint %41 1 |
| %79 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_1 |
| %80 = OpLoad %uint %79 |
| %81 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_4 %uint_1 |
| %82 = OpLoad %uint %81 |
| %83 = OpIAdd %uint %80 %82 |
| %84 = OpUGreaterThanEqual %bool %78 %83 |
| OpBranch %76 |
| %76 = OpLabel |
| %85 = OpPhi %bool %75 %65 %84 %77 |
| OpSelectionMerge %86 None |
| OpBranchConditional %85 %87 %88 |
| %87 = OpLabel |
| %89 = OpLoad %bool %success |
| OpSelectionMerge %90 None |
| OpBranchConditional %89 %91 %90 |
| %91 = OpLabel |
| %94 = OpLoad %7 %dst |
| %95 = OpBitcast %v2int %41 |
| %93 = OpImageFetch %v4float %94 %95 Lod %97 |
| %98 = OpFOrdEqual %v4bool %93 %45 |
| %92 = OpAll %bool %98 |
| OpBranch %90 |
| %90 = OpLabel |
| %100 = OpPhi %bool %89 %87 %92 %91 |
| OpStore %success %100 |
| OpBranch %86 |
| %88 = OpLabel |
| %102 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_3 |
| %103 = OpLoad %v2uint %102 |
| %104 = OpISub %v2uint %41 %103 |
| %106 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_2 |
| %107 = OpLoad %v2uint %106 |
| %108 = OpIAdd %v2uint %104 %107 |
| OpStore %srcTexCoord %108 |
| %112 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 |
| %113 = OpLoad %uint %112 |
| %114 = OpIEqual %bool %113 %uint_1 |
| OpSelectionMerge %115 None |
| OpBranchConditional %114 %116 %115 |
| %116 = OpLabel |
| %118 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1 |
| %119 = OpCompositeExtract %uint %34 1 |
| %120 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1 |
| %121 = OpLoad %uint %120 |
| %122 = OpISub %uint %119 %121 |
| %123 = OpISub %uint %122 %uint_1 |
| OpStore %118 %123 |
| OpBranch %115 |
| %115 = OpLabel |
| %125 = OpLoad %7 %src |
| %127 = OpLoad %v2uint %srcTexCoord |
| %126 = OpBitcast %v2int %127 |
| %124 = OpImageFetch %v4float %125 %126 Lod %97 |
| %129 = OpLoad %7 %dst |
| %130 = OpBitcast %v2int %41 |
| %128 = OpImageFetch %v4float %129 %130 Lod %97 |
| %131 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1 |
| %132 = OpLoad %uint %131 |
| %133 = OpIEqual %bool %132 %uint_2 |
| OpSelectionMerge %134 None |
| OpBranchConditional %133 %135 %136 |
| %135 = OpLabel |
| %137 = OpLoad %bool %success |
| OpStore %tint_symbol_1 %137 |
| %139 = OpLoad %bool %tint_symbol_1 |
| OpSelectionMerge %140 None |
| OpBranchConditional %139 %141 %140 |
| %141 = OpLabel |
| %143 = OpCompositeExtract %float %128 0 |
| %144 = OpCompositeExtract %float %124 0 |
| %142 = OpFunctionCall %bool %aboutEqual %143 %144 |
| OpStore %tint_symbol_1 %142 |
| OpBranch %140 |
| %140 = OpLabel |
| %145 = OpLoad %bool %tint_symbol_1 |
| OpStore %tint_symbol %145 |
| %147 = OpLoad %bool %tint_symbol |
| OpSelectionMerge %148 None |
| OpBranchConditional %147 %149 %148 |
| %149 = OpLabel |
| %151 = OpCompositeExtract %float %128 1 |
| %152 = OpCompositeExtract %float %124 1 |
| %150 = OpFunctionCall %bool %aboutEqual %151 %152 |
| OpStore %tint_symbol %150 |
| OpBranch %148 |
| %148 = OpLabel |
| %153 = OpLoad %bool %tint_symbol |
| OpStore %success %153 |
| OpBranch %134 |
| %136 = OpLabel |
| %154 = OpLoad %bool %success |
| OpStore %tint_symbol_5 %154 |
| %156 = OpLoad %bool %tint_symbol_5 |
| OpSelectionMerge %157 None |
| OpBranchConditional %156 %158 %157 |
| %158 = OpLabel |
| %160 = OpCompositeExtract %float %128 0 |
| %161 = OpCompositeExtract %float %124 0 |
| %159 = OpFunctionCall %bool %aboutEqual %160 %161 |
| OpStore %tint_symbol_5 %159 |
| OpBranch %157 |
| %157 = OpLabel |
| %162 = OpLoad %bool %tint_symbol_5 |
| OpStore %tint_symbol_4 %162 |
| %164 = OpLoad %bool %tint_symbol_4 |
| OpSelectionMerge %165 None |
| OpBranchConditional %164 %166 %165 |
| %166 = OpLabel |
| %168 = OpCompositeExtract %float %128 1 |
| %169 = OpCompositeExtract %float %124 1 |
| %167 = OpFunctionCall %bool %aboutEqual %168 %169 |
| OpStore %tint_symbol_4 %167 |
| OpBranch %165 |
| %165 = OpLabel |
| %170 = OpLoad %bool %tint_symbol_4 |
| OpStore %tint_symbol_3 %170 |
| %172 = OpLoad %bool %tint_symbol_3 |
| OpSelectionMerge %173 None |
| OpBranchConditional %172 %174 %173 |
| %174 = OpLabel |
| %176 = OpCompositeExtract %float %128 2 |
| %177 = OpCompositeExtract %float %124 2 |
| %175 = OpFunctionCall %bool %aboutEqual %176 %177 |
| OpStore %tint_symbol_3 %175 |
| OpBranch %173 |
| %173 = OpLabel |
| %178 = OpLoad %bool %tint_symbol_3 |
| OpStore %tint_symbol_2 %178 |
| %180 = OpLoad %bool %tint_symbol_2 |
| OpSelectionMerge %181 None |
| OpBranchConditional %180 %182 %181 |
| %182 = OpLabel |
| %184 = OpCompositeExtract %float %128 3 |
| %185 = OpCompositeExtract %float %124 3 |
| %183 = OpFunctionCall %bool %aboutEqual %184 %185 |
| OpStore %tint_symbol_2 %183 |
| OpBranch %181 |
| %181 = OpLabel |
| %186 = OpLoad %bool %tint_symbol_2 |
| OpStore %success %186 |
| OpBranch %134 |
| %134 = OpLabel |
| OpBranch %86 |
| %86 = OpLabel |
| %187 = OpCompositeExtract %uint %GlobalInvocationID 1 |
| %188 = OpCompositeExtract %uint %38 0 |
| %189 = OpIMul %uint %187 %188 |
| %190 = OpCompositeExtract %uint %GlobalInvocationID 0 |
| %191 = OpIAdd %uint %189 %190 |
| %192 = OpLoad %bool %success |
| OpSelectionMerge %193 None |
| OpBranchConditional %192 %194 %195 |
| %194 = OpLabel |
| %197 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %191 |
| OpStore %197 %uint_1 |
| OpBranch %193 |
| %195 = OpLabel |
| %198 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %191 |
| OpStore %198 %199 |
| OpBranch %193 |
| %193 = OpLabel |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %200 |
| %202 = OpLabel |
| %204 = OpLoad %v3uint %GlobalInvocationID_1 |
| %203 = OpFunctionCall %void %main_inner %204 |
| OpReturn |
| OpFunctionEnd |