blob: 416999d124879aaf086a83d5dffe1c4048c65d96 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 207
; 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
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%v4float = OpTypeVector %float 4
%44 = OpConstantNull %float
%float_1 = OpConstant %float 1
%46 = OpConstantComposite %v4float %44 %float_1 %44 %float_1
%true = OpConstantTrue %bool
%_ptr_Function_bool = OpTypePointer Function %bool
%50 = 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
%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
%201 = OpConstantNull %uint
%202 = 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 %50
%srcTexCoord = OpVariable %_ptr_Function_v2uint Function %111
%tint_symbol_1 = OpVariable %_ptr_Function_bool Function %50
%tint_symbol = OpVariable %_ptr_Function_bool Function %50
%tint_symbol_5 = OpVariable %_ptr_Function_bool Function %50
%tint_symbol_4 = OpVariable %_ptr_Function_bool Function %50
%tint_symbol_3 = OpVariable %_ptr_Function_bool Function %50
%tint_symbol_2 = OpVariable %_ptr_Function_bool Function %50
%37 = OpLoad %7 %src
%34 = OpImageQuerySizeLod %v2int %37 %int_0
%40 = OpLoad %7 %dst
%39 = OpImageQuerySizeLod %v2int %40 %int_0
%42 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
OpStore %success %true
%51 = OpCompositeExtract %uint %42 0
%55 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_0
%56 = OpLoad %uint %55
%57 = OpULessThan %bool %51 %56
OpSelectionMerge %58 None
OpBranchConditional %57 %58 %59
%59 = OpLabel
%60 = OpCompositeExtract %uint %42 1
%62 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_1
%63 = OpLoad %uint %62
%64 = OpULessThan %bool %60 %63
OpBranch %58
%58 = OpLabel
%65 = OpPhi %bool %57 %33 %64 %59
OpSelectionMerge %66 None
OpBranchConditional %65 %66 %67
%67 = OpLabel
%68 = OpCompositeExtract %uint %42 0
%69 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_0
%70 = OpLoad %uint %69
%72 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_4 %uint_0
%73 = OpLoad %uint %72
%74 = OpIAdd %uint %70 %73
%75 = OpUGreaterThanEqual %bool %68 %74
OpBranch %66
%66 = OpLabel
%76 = OpPhi %bool %65 %58 %75 %67
OpSelectionMerge %77 None
OpBranchConditional %76 %77 %78
%78 = OpLabel
%79 = OpCompositeExtract %uint %42 1
%80 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_1
%81 = OpLoad %uint %80
%82 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_4 %uint_1
%83 = OpLoad %uint %82
%84 = OpIAdd %uint %81 %83
%85 = OpUGreaterThanEqual %bool %79 %84
OpBranch %77
%77 = OpLabel
%86 = OpPhi %bool %76 %66 %85 %78
OpSelectionMerge %87 None
OpBranchConditional %86 %88 %89
%88 = OpLabel
%90 = OpLoad %bool %success
OpSelectionMerge %91 None
OpBranchConditional %90 %92 %91
%92 = OpLabel
%95 = OpLoad %7 %dst
%96 = OpBitcast %v2int %42
%94 = OpImageFetch %v4float %95 %96 Lod %97
%98 = OpFOrdEqual %v4bool %94 %46
%93 = OpAll %bool %98
OpBranch %91
%91 = OpLabel
%100 = OpPhi %bool %90 %88 %93 %92
OpStore %success %100
OpBranch %87
%89 = OpLabel
%102 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_3
%103 = OpLoad %v2uint %102
%104 = OpISub %v2uint %42 %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
%120 = OpCompositeExtract %int %34 1
%119 = OpBitcast %uint %120
%121 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
%122 = OpLoad %uint %121
%123 = OpISub %uint %119 %122
%124 = OpISub %uint %123 %uint_1
OpStore %118 %124
OpBranch %115
%115 = OpLabel
%126 = OpLoad %7 %src
%128 = OpLoad %v2uint %srcTexCoord
%127 = OpBitcast %v2int %128
%125 = OpImageFetch %v4float %126 %127 Lod %97
%130 = OpLoad %7 %dst
%131 = OpBitcast %v2int %42
%129 = OpImageFetch %v4float %130 %131 Lod %97
%132 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%133 = OpLoad %uint %132
%134 = OpIEqual %bool %133 %uint_2
OpSelectionMerge %135 None
OpBranchConditional %134 %136 %137
%136 = OpLabel
%138 = OpLoad %bool %success
OpStore %tint_symbol_1 %138
%140 = OpLoad %bool %tint_symbol_1
OpSelectionMerge %141 None
OpBranchConditional %140 %142 %141
%142 = OpLabel
%144 = OpCompositeExtract %float %129 0
%145 = OpCompositeExtract %float %125 0
%143 = OpFunctionCall %bool %aboutEqual %144 %145
OpStore %tint_symbol_1 %143
OpBranch %141
%141 = OpLabel
%146 = OpLoad %bool %tint_symbol_1
OpStore %tint_symbol %146
%148 = OpLoad %bool %tint_symbol
OpSelectionMerge %149 None
OpBranchConditional %148 %150 %149
%150 = OpLabel
%152 = OpCompositeExtract %float %129 1
%153 = OpCompositeExtract %float %125 1
%151 = OpFunctionCall %bool %aboutEqual %152 %153
OpStore %tint_symbol %151
OpBranch %149
%149 = OpLabel
%154 = OpLoad %bool %tint_symbol
OpStore %success %154
OpBranch %135
%137 = OpLabel
%155 = OpLoad %bool %success
OpStore %tint_symbol_5 %155
%157 = OpLoad %bool %tint_symbol_5
OpSelectionMerge %158 None
OpBranchConditional %157 %159 %158
%159 = OpLabel
%161 = OpCompositeExtract %float %129 0
%162 = OpCompositeExtract %float %125 0
%160 = OpFunctionCall %bool %aboutEqual %161 %162
OpStore %tint_symbol_5 %160
OpBranch %158
%158 = OpLabel
%163 = OpLoad %bool %tint_symbol_5
OpStore %tint_symbol_4 %163
%165 = OpLoad %bool %tint_symbol_4
OpSelectionMerge %166 None
OpBranchConditional %165 %167 %166
%167 = OpLabel
%169 = OpCompositeExtract %float %129 1
%170 = OpCompositeExtract %float %125 1
%168 = OpFunctionCall %bool %aboutEqual %169 %170
OpStore %tint_symbol_4 %168
OpBranch %166
%166 = OpLabel
%171 = OpLoad %bool %tint_symbol_4
OpStore %tint_symbol_3 %171
%173 = OpLoad %bool %tint_symbol_3
OpSelectionMerge %174 None
OpBranchConditional %173 %175 %174
%175 = OpLabel
%177 = OpCompositeExtract %float %129 2
%178 = OpCompositeExtract %float %125 2
%176 = OpFunctionCall %bool %aboutEqual %177 %178
OpStore %tint_symbol_3 %176
OpBranch %174
%174 = OpLabel
%179 = OpLoad %bool %tint_symbol_3
OpStore %tint_symbol_2 %179
%181 = OpLoad %bool %tint_symbol_2
OpSelectionMerge %182 None
OpBranchConditional %181 %183 %182
%183 = OpLabel
%185 = OpCompositeExtract %float %129 3
%186 = OpCompositeExtract %float %125 3
%184 = OpFunctionCall %bool %aboutEqual %185 %186
OpStore %tint_symbol_2 %184
OpBranch %182
%182 = OpLabel
%187 = OpLoad %bool %tint_symbol_2
OpStore %success %187
OpBranch %135
%135 = OpLabel
OpBranch %87
%87 = OpLabel
%188 = OpCompositeExtract %uint %GlobalInvocationID 1
%190 = OpCompositeExtract %int %39 0
%189 = OpBitcast %uint %190
%191 = OpIMul %uint %188 %189
%192 = OpCompositeExtract %uint %GlobalInvocationID 0
%193 = OpIAdd %uint %191 %192
%194 = OpLoad %bool %success
OpSelectionMerge %195 None
OpBranchConditional %194 %196 %197
%196 = OpLabel
%199 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %193
OpStore %199 %uint_1
OpBranch %195
%197 = OpLabel
%200 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %193
OpStore %200 %201
OpBranch %195
%195 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %202
%204 = OpLabel
%206 = OpLoad %v3uint %GlobalInvocationID_1
%205 = OpFunctionCall %void %main_inner %206
OpReturn
OpFunctionEnd