blob: 65d95a062024df5441f9413dc9c162fb4f5a52a9 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 206
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
%26 = 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_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
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 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 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
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%bool = OpTypeBool
%19 = OpTypeFunction %bool %float %float
%float_0_00100000005 = OpConstant %float 0.00100000005
%void = OpTypeVoid
%30 = OpTypeFunction %void %v3uint
%int = OpTypeInt 32 1
%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_0 = OpConstant %uint 0
%uint_3 = OpConstant %uint 3
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%uint_4 = OpConstant %uint 4
%v2int = OpTypeVector %int 2
%98 = OpConstantNull %int
%v4bool = OpTypeVector %bool 4
%_ptr_Uniform_v2uint = OpTypePointer Uniform %v2uint
%uint_2 = OpConstant %uint 2
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
%112 = OpConstantNull %v2uint
%_ptr_Function_uint = OpTypePointer Function %uint
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%200 = OpConstantNull %uint
%201 = OpTypeFunction %void
%aboutEqual = OpFunction %bool None %19
%value = OpFunctionParameter %float
%expect = OpFunctionParameter %float
%24 = OpLabel
%27 = OpFSub %float %value %expect
%25 = OpExtInst %float %26 FAbs %27
%29 = OpFOrdLessThan %bool %25 %float_0_00100000005
OpReturnValue %29
OpFunctionEnd
%main_inner = OpFunction %void None %30
%GlobalInvocationID = OpFunctionParameter %v3uint
%34 = OpLabel
%success = OpVariable %_ptr_Function_bool Function %50
%srcTexCoord = OpVariable %_ptr_Function_v2uint Function %112
%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
%36 = OpLoad %7 %src
%35 = OpImageQuerySizeLod %v2uint %36 %int_0
%40 = OpLoad %7 %dst
%39 = OpImageQuerySizeLod %v2uint %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_0 %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_0 %uint_3 %uint_1
%63 = OpLoad %uint %62
%64 = OpULessThan %bool %60 %63
OpBranch %58
%58 = OpLabel
%65 = OpPhi %bool %57 %34 %64 %59
OpSelectionMerge %66 None
OpBranchConditional %65 %66 %67
%67 = OpLabel
%68 = OpCompositeExtract %uint %42 0
%69 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_3 %uint_0
%70 = OpLoad %uint %69
%72 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %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_0 %uint_3 %uint_1
%81 = OpLoad %uint %80
%82 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %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 %98
%99 = OpFOrdEqual %v4bool %94 %46
%93 = OpAll %bool %99
OpBranch %91
%91 = OpLabel
%101 = OpPhi %bool %90 %88 %93 %92
OpStore %success %101
OpBranch %87
%89 = OpLabel
%103 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_0 %uint_3
%104 = OpLoad %v2uint %103
%105 = OpISub %v2uint %42 %104
%107 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_0 %uint_2
%108 = OpLoad %v2uint %107
%109 = OpIAdd %v2uint %105 %108
OpStore %srcTexCoord %109
%113 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%114 = OpLoad %uint %113
%115 = OpIEqual %bool %114 %uint_1
OpSelectionMerge %116 None
OpBranchConditional %115 %117 %116
%117 = OpLabel
%119 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
%120 = OpCompositeExtract %uint %35 1
%121 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
%122 = OpLoad %uint %121
%123 = OpISub %uint %120 %122
%124 = OpISub %uint %123 %uint_1
OpStore %119 %124
OpBranch %116
%116 = OpLabel
%126 = OpLoad %7 %src
%128 = OpLoad %v2uint %srcTexCoord
%127 = OpBitcast %v2int %128
%125 = OpImageFetch %v4float %126 %127 Lod %98
%130 = OpLoad %7 %dst
%131 = OpBitcast %v2int %42
%129 = OpImageFetch %v4float %130 %131 Lod %98
%132 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %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
%189 = OpCompositeExtract %uint %39 0
%190 = OpIMul %uint %188 %189
%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 %200
OpBranch %194
%194 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %201
%203 = OpLabel
%205 = OpLoad %v3uint %GlobalInvocationID_1
%204 = OpFunctionCall %void %main_inner %205
OpReturn
OpFunctionEnd