| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 134 |
| ; Schema: 0 |
| OpCapability Shader |
| OpCapability ImageQuery |
| 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 "isFloat16" |
| OpMemberName %Uniforms 2 "isRGB10A2Unorm" |
| OpMemberName %Uniforms 3 "channelCount" |
| OpName %uniforms "uniforms" |
| OpName %ConvertToFp16FloatValue "ConvertToFp16FloatValue" |
| OpName %fp32 "fp32" |
| OpName %main_inner "main_inner" |
| OpName %GlobalInvocationID "GlobalInvocationID" |
| OpName %size "size" |
| OpName %dstTexCoord "dstTexCoord" |
| OpName %srcTexCoord "srcTexCoord" |
| OpName %srcColor "srcColor" |
| OpName %dstColor "dstColor" |
| OpName %success "success" |
| OpName %srcColorBits "srcColorBits" |
| OpName %dstColorBits "dstColorBits" |
| OpName %i "i" |
| OpName %outputIndex "outputIndex" |
| 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 12 |
| 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 |
| %Uniforms = OpTypeStruct %uint %uint %uint %uint |
| %_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms |
| %uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform |
| %17 = OpTypeFunction %uint %float |
| %uint_1 = OpConstant %uint 1 |
| %void = OpTypeVoid |
| %22 = OpTypeFunction %void %v3uint |
| %v2uint = OpTypeVector %uint 2 |
| %int = OpTypeInt 32 1 |
| %int_0 = OpConstant %int 0 |
| %_ptr_Function_v2uint = OpTypePointer Function %v2uint |
| %34 = OpConstantNull %v2uint |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_Uniform_uint = OpTypePointer Uniform %uint |
| %bool = OpTypeBool |
| %_ptr_Function_uint = OpTypePointer Function %uint |
| %v4float = OpTypeVector %float 4 |
| %59 = OpConstantNull %int |
| %_ptr_Function_v4float = OpTypePointer Function %v4float |
| %62 = OpConstantNull %v4float |
| %true = OpConstantTrue %bool |
| %_ptr_Function_bool = OpTypePointer Function %bool |
| %70 = OpConstantNull %bool |
| %v4uint = OpTypeVector %uint 4 |
| %_ptr_Function_v4uint = OpTypePointer Function %v4uint |
| %74 = OpConstantNull %v4uint |
| %78 = OpConstantNull %uint |
| %uint_3 = OpConstant %uint 3 |
| %_ptr_Function_float = OpTypePointer Function %float |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint |
| %129 = OpTypeFunction %void |
| %ConvertToFp16FloatValue = OpFunction %uint None %17 |
| %fp32 = OpFunctionParameter %float |
| %20 = OpLabel |
| OpReturnValue %uint_1 |
| OpFunctionEnd |
| %main_inner = OpFunction %void None %22 |
| %GlobalInvocationID = OpFunctionParameter %v3uint |
| %26 = OpLabel |
| %size = OpVariable %_ptr_Function_v2uint Function %34 |
| %dstTexCoord = OpVariable %_ptr_Function_v2uint Function %34 |
| %srcTexCoord = OpVariable %_ptr_Function_v2uint Function %34 |
| %srcColor = OpVariable %_ptr_Function_v4float Function %62 |
| %dstColor = OpVariable %_ptr_Function_v4float Function %62 |
| %success = OpVariable %_ptr_Function_bool Function %70 |
| %srcColorBits = OpVariable %_ptr_Function_v4uint Function %74 |
| %dstColorBits = OpVariable %_ptr_Function_v4uint Function %74 |
| %i = OpVariable %_ptr_Function_uint Function %78 |
| %outputIndex = OpVariable %_ptr_Function_uint Function %78 |
| %29 = OpLoad %7 %src |
| %27 = OpImageQuerySizeLod %v2uint %29 %int_0 |
| OpStore %size %27 |
| %35 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1 |
| OpStore %dstTexCoord %35 |
| %37 = OpLoad %v2uint %dstTexCoord |
| OpStore %srcTexCoord %37 |
| %41 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 |
| %42 = OpLoad %uint %41 |
| %43 = OpIEqual %bool %42 %uint_1 |
| OpSelectionMerge %45 None |
| OpBranchConditional %43 %46 %45 |
| %46 = OpLabel |
| %48 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1 |
| %49 = OpAccessChain %_ptr_Function_uint %size %uint_1 |
| %50 = OpLoad %uint %49 |
| %51 = OpAccessChain %_ptr_Function_uint %dstTexCoord %uint_1 |
| %52 = OpLoad %uint %51 |
| %53 = OpISub %uint %50 %52 |
| %54 = OpISub %uint %53 %uint_1 |
| OpStore %48 %54 |
| OpBranch %45 |
| %45 = OpLabel |
| %57 = OpLoad %7 %src |
| %58 = OpLoad %v2uint %srcTexCoord |
| %55 = OpImageFetch %v4float %57 %58 Lod %59 |
| OpStore %srcColor %55 |
| %64 = OpLoad %7 %dst |
| %65 = OpLoad %v2uint %dstTexCoord |
| %63 = OpImageFetch %v4float %64 %65 Lod %59 |
| OpStore %dstColor %63 |
| OpStore %success %true |
| %76 = OpLoad %v4float %dstColor |
| %75 = OpConvertFToU %v4uint %76 |
| OpStore %dstColorBits %75 |
| OpStore %i %78 |
| OpBranch %80 |
| %80 = OpLabel |
| OpLoopMerge %81 %82 None |
| OpBranch %83 |
| %83 = OpLabel |
| %85 = OpLoad %uint %i |
| %87 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 |
| %88 = OpLoad %uint %87 |
| %89 = OpULessThan %bool %85 %88 |
| %84 = OpLogicalNot %bool %89 |
| OpSelectionMerge %90 None |
| OpBranchConditional %84 %91 %90 |
| %91 = OpLabel |
| OpBranch %81 |
| %90 = OpLabel |
| %93 = OpLoad %uint %i |
| %95 = OpAccessChain %_ptr_Function_float %srcColor %93 |
| %96 = OpLoad %float %95 |
| %92 = OpFunctionCall %uint %ConvertToFp16FloatValue %96 |
| %97 = OpLoad %uint %i |
| %98 = OpAccessChain %_ptr_Function_uint %srcColorBits %97 |
| OpStore %98 %92 |
| %99 = OpLoad %bool %success |
| OpSelectionMerge %100 None |
| OpBranchConditional %99 %101 %100 |
| %101 = OpLabel |
| %102 = OpLoad %uint %i |
| %103 = OpAccessChain %_ptr_Function_uint %srcColorBits %102 |
| %104 = OpLoad %uint %103 |
| %105 = OpLoad %uint %i |
| %106 = OpAccessChain %_ptr_Function_uint %dstColorBits %105 |
| %107 = OpLoad %uint %106 |
| %108 = OpIEqual %bool %104 %107 |
| OpBranch %100 |
| %100 = OpLabel |
| %109 = OpPhi %bool %99 %90 %108 %101 |
| OpStore %success %109 |
| OpBranch %82 |
| %82 = OpLabel |
| %110 = OpLoad %uint %i |
| %111 = OpIAdd %uint %110 %uint_1 |
| OpStore %i %111 |
| OpBranch %80 |
| %81 = OpLabel |
| %112 = OpCompositeExtract %uint %GlobalInvocationID 1 |
| %114 = OpAccessChain %_ptr_Function_uint %size %uint_0 |
| %115 = OpLoad %uint %114 |
| %116 = OpIMul %uint %112 %115 |
| %117 = OpCompositeExtract %uint %GlobalInvocationID 0 |
| %118 = OpIAdd %uint %116 %117 |
| OpStore %outputIndex %118 |
| %120 = OpLoad %bool %success |
| OpSelectionMerge %121 None |
| OpBranchConditional %120 %122 %123 |
| %122 = OpLabel |
| %124 = OpLoad %uint %outputIndex |
| %126 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %124 |
| OpStore %126 %uint_1 |
| OpBranch %121 |
| %123 = OpLabel |
| %127 = OpLoad %uint %outputIndex |
| %128 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %127 |
| OpStore %128 %78 |
| OpBranch %121 |
| %121 = OpLabel |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %129 |
| %131 = OpLabel |
| %133 = OpLoad %v3uint %GlobalInvocationID_1 |
| %132 = OpFunctionCall %void %main_inner %133 |
| OpReturn |
| OpFunctionEnd |