blob: 73b58b380b327ae1d299dbb963e3d25b2635ec24 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 205
; 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
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%46 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %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
%v4bool = OpTypeVector %bool 4
%_ptr_Uniform_v2uint = OpTypePointer Uniform %v2uint
%uint_2 = OpConstant %uint 2
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
%110 = OpConstantNull %v2uint
%_ptr_Function_uint = OpTypePointer Function %uint
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%200 = 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 %110
%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 %int_0
%97 = OpFOrdEqual %v4bool %94 %46
%93 = OpAll %bool %97
OpBranch %91
%91 = OpLabel
%99 = OpPhi %bool %90 %88 %93 %92
OpStore %success %99
OpBranch %87
%89 = OpLabel
%101 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_3
%102 = OpLoad %v2uint %101
%103 = OpISub %v2uint %42 %102
%105 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_2
%106 = OpLoad %v2uint %105
%107 = OpIAdd %v2uint %103 %106
OpStore %srcTexCoord %107
%111 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%112 = OpLoad %uint %111
%113 = OpIEqual %bool %112 %uint_1
OpSelectionMerge %114 None
OpBranchConditional %113 %115 %114
%115 = OpLabel
%117 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
%119 = OpCompositeExtract %int %34 1
%118 = OpBitcast %uint %119
%120 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
%121 = OpLoad %uint %120
%122 = OpISub %uint %118 %121
%123 = OpISub %uint %122 %uint_1
OpStore %117 %123
OpBranch %114
%114 = OpLabel
%125 = OpLoad %7 %src
%127 = OpLoad %v2uint %srcTexCoord
%126 = OpBitcast %v2int %127
%124 = OpImageFetch %v4float %125 %126 Lod %int_0
%129 = OpLoad %7 %dst
%130 = OpBitcast %v2int %42
%128 = OpImageFetch %v4float %129 %130 Lod %int_0
%131 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%132 = OpLoad %uint %131
%133 = OpIEqual %bool %132 %uint_2
OpSelectionMerge %134 None
OpBranchConditional %133 %135 %136
%135 = OpLabel
%137 = OpLoad %bool %success
OpStore %tint_symbol_1 %137
%139 = OpLoad %bool %tint_symbol_1
OpSelectionMerge %140 None
OpBranchConditional %139 %141 %140
%141 = OpLabel
%143 = OpCompositeExtract %float %128 0
%144 = OpCompositeExtract %float %124 0
%142 = OpFunctionCall %bool %aboutEqual %143 %144
OpStore %tint_symbol_1 %142
OpBranch %140
%140 = OpLabel
%145 = OpLoad %bool %tint_symbol_1
OpStore %tint_symbol %145
%147 = OpLoad %bool %tint_symbol
OpSelectionMerge %148 None
OpBranchConditional %147 %149 %148
%149 = OpLabel
%151 = OpCompositeExtract %float %128 1
%152 = OpCompositeExtract %float %124 1
%150 = OpFunctionCall %bool %aboutEqual %151 %152
OpStore %tint_symbol %150
OpBranch %148
%148 = OpLabel
%153 = OpLoad %bool %tint_symbol
OpStore %success %153
OpBranch %134
%136 = OpLabel
%154 = OpLoad %bool %success
OpStore %tint_symbol_5 %154
%156 = OpLoad %bool %tint_symbol_5
OpSelectionMerge %157 None
OpBranchConditional %156 %158 %157
%158 = OpLabel
%160 = OpCompositeExtract %float %128 0
%161 = OpCompositeExtract %float %124 0
%159 = OpFunctionCall %bool %aboutEqual %160 %161
OpStore %tint_symbol_5 %159
OpBranch %157
%157 = OpLabel
%162 = OpLoad %bool %tint_symbol_5
OpStore %tint_symbol_4 %162
%164 = OpLoad %bool %tint_symbol_4
OpSelectionMerge %165 None
OpBranchConditional %164 %166 %165
%166 = OpLabel
%168 = OpCompositeExtract %float %128 1
%169 = OpCompositeExtract %float %124 1
%167 = OpFunctionCall %bool %aboutEqual %168 %169
OpStore %tint_symbol_4 %167
OpBranch %165
%165 = OpLabel
%170 = OpLoad %bool %tint_symbol_4
OpStore %tint_symbol_3 %170
%172 = OpLoad %bool %tint_symbol_3
OpSelectionMerge %173 None
OpBranchConditional %172 %174 %173
%174 = OpLabel
%176 = OpCompositeExtract %float %128 2
%177 = OpCompositeExtract %float %124 2
%175 = OpFunctionCall %bool %aboutEqual %176 %177
OpStore %tint_symbol_3 %175
OpBranch %173
%173 = OpLabel
%178 = OpLoad %bool %tint_symbol_3
OpStore %tint_symbol_2 %178
%180 = OpLoad %bool %tint_symbol_2
OpSelectionMerge %181 None
OpBranchConditional %180 %182 %181
%182 = OpLabel
%184 = OpCompositeExtract %float %128 3
%185 = OpCompositeExtract %float %124 3
%183 = OpFunctionCall %bool %aboutEqual %184 %185
OpStore %tint_symbol_2 %183
OpBranch %181
%181 = OpLabel
%186 = OpLoad %bool %tint_symbol_2
OpStore %success %186
OpBranch %134
%134 = OpLabel
OpBranch %87
%87 = OpLabel
%187 = OpCompositeExtract %uint %GlobalInvocationID 1
%189 = OpCompositeExtract %int %39 0
%188 = OpBitcast %uint %189
%190 = OpIMul %uint %187 %188
%191 = OpCompositeExtract %uint %GlobalInvocationID 0
%192 = OpIAdd %uint %190 %191
%193 = OpLoad %bool %success
OpSelectionMerge %194 None
OpBranchConditional %193 %195 %196
%195 = OpLabel
%198 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %192
OpStore %198 %uint_1
OpBranch %194
%196 = OpLabel
%199 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %192
OpStore %199 %uint_0
OpBranch %194
%194 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %200
%202 = OpLabel
%204 = OpLoad %v3uint %GlobalInvocationID_1
%203 = OpFunctionCall %void %main_inner %204
OpReturn
OpFunctionEnd