| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 133 |
| ; 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 %uint |
| %_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 |
| %uint_3 = OpConstant %uint 3 |
| %_ptr_Function_float = OpTypePointer Function %float |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint |
| %128 = 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 %59 |
| %outputIndex = OpVariable %_ptr_Function_uint Function %59 |
| %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 %59 |
| OpBranch %79 |
| %79 = OpLabel |
| OpLoopMerge %80 %81 None |
| OpBranch %82 |
| %82 = OpLabel |
| %84 = OpLoad %uint %i |
| %86 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 |
| %87 = OpLoad %uint %86 |
| %88 = OpULessThan %bool %84 %87 |
| %83 = OpLogicalNot %bool %88 |
| OpSelectionMerge %89 None |
| OpBranchConditional %83 %90 %89 |
| %90 = OpLabel |
| OpBranch %80 |
| %89 = OpLabel |
| %92 = OpLoad %uint %i |
| %94 = OpAccessChain %_ptr_Function_float %srcColor %92 |
| %95 = OpLoad %float %94 |
| %91 = OpFunctionCall %uint %ConvertToFp16FloatValue %95 |
| %96 = OpLoad %uint %i |
| %97 = OpAccessChain %_ptr_Function_uint %srcColorBits %96 |
| OpStore %97 %91 |
| %98 = OpLoad %bool %success |
| OpSelectionMerge %99 None |
| OpBranchConditional %98 %100 %99 |
| %100 = OpLabel |
| %101 = OpLoad %uint %i |
| %102 = OpAccessChain %_ptr_Function_uint %srcColorBits %101 |
| %103 = OpLoad %uint %102 |
| %104 = OpLoad %uint %i |
| %105 = OpAccessChain %_ptr_Function_uint %dstColorBits %104 |
| %106 = OpLoad %uint %105 |
| %107 = OpIEqual %bool %103 %106 |
| OpBranch %99 |
| %99 = OpLabel |
| %108 = OpPhi %bool %98 %89 %107 %100 |
| OpStore %success %108 |
| OpBranch %81 |
| %81 = OpLabel |
| %109 = OpLoad %uint %i |
| %110 = OpIAdd %uint %109 %uint_1 |
| OpStore %i %110 |
| OpBranch %79 |
| %80 = OpLabel |
| %111 = OpCompositeExtract %uint %GlobalInvocationID 1 |
| %113 = OpAccessChain %_ptr_Function_uint %size %uint_0 |
| %114 = OpLoad %uint %113 |
| %115 = OpIMul %uint %111 %114 |
| %116 = OpCompositeExtract %uint %GlobalInvocationID 0 |
| %117 = OpIAdd %uint %115 %116 |
| OpStore %outputIndex %117 |
| %119 = OpLoad %bool %success |
| OpSelectionMerge %120 None |
| OpBranchConditional %119 %121 %122 |
| %121 = OpLabel |
| %123 = OpLoad %uint %outputIndex |
| %125 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %123 |
| OpStore %125 %uint_1 |
| OpBranch %120 |
| %122 = OpLabel |
| %126 = OpLoad %uint %outputIndex |
| %127 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %126 |
| OpStore %127 %59 |
| OpBranch %120 |
| %120 = OpLabel |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %128 |
| %130 = OpLabel |
| %132 = OpLoad %v3uint %GlobalInvocationID_1 |
| %131 = OpFunctionCall %void %main_inner %132 |
| OpReturn |
| OpFunctionEnd |