blob: 9b373fd4f330271a1cacca75b99f740bff47689c [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 135
; 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_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
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 Block
OpMemberDecorate %uniforms_block 0 Offset 0
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
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%18 = OpTypeFunction %uint %float
%uint_1 = OpConstant %uint 1
%void = OpTypeVoid
%23 = OpTypeFunction %void %v3uint
%v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
%35 = 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
%60 = OpConstantNull %int
%_ptr_Function_v4float = OpTypePointer Function %v4float
%63 = OpConstantNull %v4float
%true = OpConstantTrue %bool
%_ptr_Function_bool = OpTypePointer Function %bool
%71 = OpConstantNull %bool
%v4uint = OpTypeVector %uint 4
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
%75 = OpConstantNull %v4uint
%79 = OpConstantNull %uint
%uint_3 = OpConstant %uint 3
%_ptr_Function_float = OpTypePointer Function %float
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%130 = OpTypeFunction %void
%ConvertToFp16FloatValue = OpFunction %uint None %18
%fp32 = OpFunctionParameter %float
%21 = OpLabel
OpReturnValue %uint_1
OpFunctionEnd
%main_inner = OpFunction %void None %23
%GlobalInvocationID = OpFunctionParameter %v3uint
%27 = OpLabel
%size = OpVariable %_ptr_Function_v2uint Function %35
%dstTexCoord = OpVariable %_ptr_Function_v2uint Function %35
%srcTexCoord = OpVariable %_ptr_Function_v2uint Function %35
%srcColor = OpVariable %_ptr_Function_v4float Function %63
%dstColor = OpVariable %_ptr_Function_v4float Function %63
%success = OpVariable %_ptr_Function_bool Function %71
%srcColorBits = OpVariable %_ptr_Function_v4uint Function %75
%dstColorBits = OpVariable %_ptr_Function_v4uint Function %75
%i = OpVariable %_ptr_Function_uint Function %79
%outputIndex = OpVariable %_ptr_Function_uint Function %79
%30 = OpLoad %7 %src
%28 = OpImageQuerySizeLod %v2uint %30 %int_0
OpStore %size %28
%36 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
OpStore %dstTexCoord %36
%38 = OpLoad %v2uint %dstTexCoord
OpStore %srcTexCoord %38
%42 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%43 = OpLoad %uint %42
%44 = OpIEqual %bool %43 %uint_1
OpSelectionMerge %46 None
OpBranchConditional %44 %47 %46
%47 = OpLabel
%49 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
%50 = OpAccessChain %_ptr_Function_uint %size %uint_1
%51 = OpLoad %uint %50
%52 = OpAccessChain %_ptr_Function_uint %dstTexCoord %uint_1
%53 = OpLoad %uint %52
%54 = OpISub %uint %51 %53
%55 = OpISub %uint %54 %uint_1
OpStore %49 %55
OpBranch %46
%46 = OpLabel
%58 = OpLoad %7 %src
%59 = OpLoad %v2uint %srcTexCoord
%56 = OpImageFetch %v4float %58 %59 Lod %60
OpStore %srcColor %56
%65 = OpLoad %7 %dst
%66 = OpLoad %v2uint %dstTexCoord
%64 = OpImageFetch %v4float %65 %66 Lod %60
OpStore %dstColor %64
OpStore %success %true
%77 = OpLoad %v4float %dstColor
%76 = OpConvertFToU %v4uint %77
OpStore %dstColorBits %76
OpStore %i %79
OpBranch %81
%81 = OpLabel
OpLoopMerge %82 %83 None
OpBranch %84
%84 = OpLabel
%86 = OpLoad %uint %i
%88 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_3
%89 = OpLoad %uint %88
%90 = OpULessThan %bool %86 %89
%85 = OpLogicalNot %bool %90
OpSelectionMerge %91 None
OpBranchConditional %85 %92 %91
%92 = OpLabel
OpBranch %82
%91 = OpLabel
%93 = OpLoad %uint %i
%94 = OpAccessChain %_ptr_Function_uint %srcColorBits %93
%96 = OpLoad %uint %i
%98 = OpAccessChain %_ptr_Function_float %srcColor %96
%99 = OpLoad %float %98
%95 = OpFunctionCall %uint %ConvertToFp16FloatValue %99
OpStore %94 %95
%100 = OpLoad %bool %success
OpSelectionMerge %101 None
OpBranchConditional %100 %102 %101
%102 = OpLabel
%103 = OpLoad %uint %i
%104 = OpAccessChain %_ptr_Function_uint %srcColorBits %103
%105 = OpLoad %uint %104
%106 = OpLoad %uint %i
%107 = OpAccessChain %_ptr_Function_uint %dstColorBits %106
%108 = OpLoad %uint %107
%109 = OpIEqual %bool %105 %108
OpBranch %101
%101 = OpLabel
%110 = OpPhi %bool %100 %91 %109 %102
OpStore %success %110
OpBranch %83
%83 = OpLabel
%111 = OpLoad %uint %i
%112 = OpIAdd %uint %111 %uint_1
OpStore %i %112
OpBranch %81
%82 = OpLabel
%113 = OpCompositeExtract %uint %GlobalInvocationID 1
%115 = OpAccessChain %_ptr_Function_uint %size %uint_0
%116 = OpLoad %uint %115
%117 = OpIMul %uint %113 %116
%118 = OpCompositeExtract %uint %GlobalInvocationID 0
%119 = OpIAdd %uint %117 %118
OpStore %outputIndex %119
%121 = OpLoad %bool %success
OpSelectionMerge %122 None
OpBranchConditional %121 %123 %124
%123 = OpLabel
%125 = OpLoad %uint %outputIndex
%127 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %125
OpStore %127 %uint_1
OpBranch %122
%124 = OpLabel
%128 = OpLoad %uint %outputIndex
%129 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %128
OpStore %129 %79
OpBranch %122
%122 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %130
%132 = OpLabel
%134 = OpLoad %v3uint %GlobalInvocationID_1
%133 = OpFunctionCall %void %main_inner %134
OpReturn
OpFunctionEnd