blob: 0254aab7f26336f55f49a4837b0d4ef44959e13a [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 137
; 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
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
%34 = OpConstantNull %v2int
%v2uint = OpTypeVector %uint 2
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%bool = OpTypeBool
%_ptr_Function_int = OpTypePointer Function %int
%int_1 = OpConstant %int 1
%v4float = OpTypeVector %float 4
%_ptr_Function_v4float = OpTypePointer Function %v4float
%64 = OpConstantNull %v4float
%true = OpConstantTrue %bool
%_ptr_Function_bool = OpTypePointer Function %bool
%72 = OpConstantNull %bool
%v4uint = OpTypeVector %uint 4
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
%76 = OpConstantNull %v4uint
%_ptr_Function_uint = OpTypePointer Function %uint
%82 = OpConstantNull %uint
%uint_3 = OpConstant %uint 3
%_ptr_Function_float = OpTypePointer Function %float
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%132 = 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_v2int Function %34
%dstTexCoord = OpVariable %_ptr_Function_v2int Function %34
%srcTexCoord = OpVariable %_ptr_Function_v2int Function %34
%srcColor = OpVariable %_ptr_Function_v4float Function %64
%dstColor = OpVariable %_ptr_Function_v4float Function %64
%success = OpVariable %_ptr_Function_bool Function %72
%srcColorBits = OpVariable %_ptr_Function_v4uint Function %76
%dstColorBits = OpVariable %_ptr_Function_v4uint Function %76
%i = OpVariable %_ptr_Function_uint Function %82
%outputIndex = OpVariable %_ptr_Function_uint Function %82
%30 = OpLoad %7 %src
%27 = OpImageQuerySizeLod %v2int %30 %int_0
OpStore %size %27
%37 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
%35 = OpBitcast %v2int %37
OpStore %dstTexCoord %35
%39 = OpLoad %v2int %dstTexCoord
OpStore %srcTexCoord %39
%43 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%44 = OpLoad %uint %43
%45 = OpIEqual %bool %44 %uint_1
OpSelectionMerge %47 None
OpBranchConditional %45 %48 %47
%48 = OpLabel
%50 = OpAccessChain %_ptr_Function_int %srcTexCoord %uint_1
%51 = OpAccessChain %_ptr_Function_int %size %uint_1
%52 = OpLoad %int %51
%53 = OpAccessChain %_ptr_Function_int %dstTexCoord %uint_1
%54 = OpLoad %int %53
%55 = OpISub %int %52 %54
%57 = OpISub %int %55 %int_1
OpStore %50 %57
OpBranch %47
%47 = OpLabel
%60 = OpLoad %7 %src
%61 = OpLoad %v2int %srcTexCoord
%58 = OpImageFetch %v4float %60 %61 Lod %int_0
OpStore %srcColor %58
%66 = OpLoad %7 %dst
%67 = OpLoad %v2int %dstTexCoord
%65 = OpImageFetch %v4float %66 %67 Lod %int_0
OpStore %dstColor %65
OpStore %success %true
%78 = OpLoad %v4float %dstColor
%77 = OpConvertFToU %v4uint %78
OpStore %dstColorBits %77
OpStore %i %uint_0
OpBranch %83
%83 = OpLabel
OpLoopMerge %84 %85 None
OpBranch %86
%86 = OpLabel
%88 = OpLoad %uint %i
%90 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3
%91 = OpLoad %uint %90
%92 = OpULessThan %bool %88 %91
%87 = OpLogicalNot %bool %92
OpSelectionMerge %93 None
OpBranchConditional %87 %94 %93
%94 = OpLabel
OpBranch %84
%93 = OpLabel
%95 = OpLoad %uint %i
%96 = OpAccessChain %_ptr_Function_uint %srcColorBits %95
%98 = OpLoad %uint %i
%100 = OpAccessChain %_ptr_Function_float %srcColor %98
%101 = OpLoad %float %100
%97 = OpFunctionCall %uint %ConvertToFp16FloatValue %101
OpStore %96 %97
%102 = OpLoad %bool %success
OpSelectionMerge %103 None
OpBranchConditional %102 %104 %103
%104 = OpLabel
%105 = OpLoad %uint %i
%106 = OpAccessChain %_ptr_Function_uint %srcColorBits %105
%107 = OpLoad %uint %106
%108 = OpLoad %uint %i
%109 = OpAccessChain %_ptr_Function_uint %dstColorBits %108
%110 = OpLoad %uint %109
%111 = OpIEqual %bool %107 %110
OpBranch %103
%103 = OpLabel
%112 = OpPhi %bool %102 %93 %111 %104
OpStore %success %112
OpBranch %85
%85 = OpLabel
%113 = OpLoad %uint %i
%114 = OpIAdd %uint %113 %uint_1
OpStore %i %114
OpBranch %83
%84 = OpLabel
%115 = OpCompositeExtract %uint %GlobalInvocationID 1
%117 = OpAccessChain %_ptr_Function_int %size %uint_0
%118 = OpLoad %int %117
%116 = OpBitcast %uint %118
%119 = OpIMul %uint %115 %116
%120 = OpCompositeExtract %uint %GlobalInvocationID 0
%121 = OpIAdd %uint %119 %120
OpStore %outputIndex %121
%123 = OpLoad %bool %success
OpSelectionMerge %124 None
OpBranchConditional %123 %125 %126
%125 = OpLabel
%127 = OpLoad %uint %outputIndex
%129 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %127
OpStore %129 %uint_1
OpBranch %124
%126 = OpLabel
%130 = OpLoad %uint %outputIndex
%131 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %130
OpStore %131 %uint_0
OpBranch %124
%124 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %132
%134 = OpLabel
%136 = OpLoad %v3uint %GlobalInvocationID_1
%135 = OpFunctionCall %void %main_inner %136
OpReturn
OpFunctionEnd