blob: 22c15c0c6a4eb1be287acc39574c692c694ee0dd [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 251
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %WorkGroupID_1 %LocalInvocationID_1 %local_invocation_index_1
OpExecutionMode %main LocalSize 64 1 1
OpName %WorkGroupID_1 "WorkGroupID_1"
OpName %LocalInvocationID_1 "LocalInvocationID_1"
OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %samp "samp"
OpName %Params "Params"
OpMemberName %Params 0 "filterDim"
OpMemberName %Params 1 "blockDim"
OpName %params "params"
OpName %inputTex "inputTex"
OpName %outputTex "outputTex"
OpName %Flip "Flip"
OpMemberName %Flip 0 "value"
OpName %flip "flip"
OpName %tile "tile"
OpName %main_inner "main_inner"
OpName %WorkGroupID "WorkGroupID"
OpName %LocalInvocationID "LocalInvocationID"
OpName %local_invocation_index "local_invocation_index"
OpName %idx "idx"
OpName %r "r"
OpName %c "c"
OpName %loadIndex "loadIndex"
OpName %r_0 "r"
OpName %c_0 "c"
OpName %writeIndex "writeIndex"
OpName %acc "acc"
OpName %f "f"
OpName %i "i"
OpName %main "main"
OpDecorate %WorkGroupID_1 BuiltIn WorkgroupId
OpDecorate %LocalInvocationID_1 BuiltIn LocalInvocationId
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
OpDecorate %samp DescriptorSet 0
OpDecorate %samp Binding 0
OpDecorate %Params Block
OpMemberDecorate %Params 0 Offset 0
OpMemberDecorate %Params 1 Offset 4
OpDecorate %params NonWritable
OpDecorate %params DescriptorSet 0
OpDecorate %params Binding 1
OpDecorate %inputTex DescriptorSet 1
OpDecorate %inputTex Binding 1
OpDecorate %outputTex NonReadable
OpDecorate %outputTex DescriptorSet 1
OpDecorate %outputTex Binding 2
OpDecorate %Flip Block
OpMemberDecorate %Flip 0 Offset 0
OpDecorate %flip NonWritable
OpDecorate %flip DescriptorSet 1
OpDecorate %flip Binding 3
OpDecorate %_arr_v3float_uint_256 ArrayStride 16
OpDecorate %_arr__arr_v3float_uint_256_uint_4 ArrayStride 4096
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%WorkGroupID_1 = OpVariable %_ptr_Input_v3uint Input
%LocalInvocationID_1 = OpVariable %_ptr_Input_v3uint Input
%_ptr_Input_uint = OpTypePointer Input %uint
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%samp = OpVariable %_ptr_UniformConstant_10 UniformConstant
%Params = OpTypeStruct %uint %uint
%_ptr_Uniform_Params = OpTypePointer Uniform %Params
%params = OpVariable %_ptr_Uniform_Params Uniform
%float = OpTypeFloat 32
%16 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_16 = OpTypePointer UniformConstant %16
%inputTex = OpVariable %_ptr_UniformConstant_16 UniformConstant
%20 = OpTypeImage %float 2D 0 0 0 2 Rgba8
%_ptr_UniformConstant_20 = OpTypePointer UniformConstant %20
%outputTex = OpVariable %_ptr_UniformConstant_20 UniformConstant
%Flip = OpTypeStruct %uint
%_ptr_Uniform_Flip = OpTypePointer Uniform %Flip
%flip = OpVariable %_ptr_Uniform_Flip Uniform
%v3float = OpTypeVector %float 3
%uint_256 = OpConstant %uint 256
%_arr_v3float_uint_256 = OpTypeArray %v3float %uint_256
%uint_4 = OpConstant %uint 4
%_arr__arr_v3float_uint_256_uint_4 = OpTypeArray %_arr_v3float_uint_256 %uint_4
%_ptr_Workgroup__arr__arr_v3float_uint_256_uint_4 = OpTypePointer Workgroup %_arr__arr_v3float_uint_256_uint_4
%tile = OpVariable %_ptr_Workgroup__arr__arr_v3float_uint_256_uint_4 Workgroup
%void = OpTypeVoid
%31 = OpTypeFunction %void %v3uint %v3uint %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%40 = OpConstantNull %uint
%uint_1024 = OpConstant %uint 1024
%bool = OpTypeBool
%_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
%58 = OpConstantNull %v3float
%uint_64 = OpConstant %uint 64
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1
%76 = OpConstantNull %int
%83 = OpConstantComposite %v2uint %uint_4 %uint_1
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
%114 = OpConstantNull %v2uint
%v4float = OpTypeVector %float 4
%132 = OpTypeSampledImage %16
%v2float = OpTypeVector %float 2
%float_0_25 = OpConstant %float 0.25
%138 = OpConstantComposite %v2float %float_0_25 %float_0_25
%142 = OpConstantNull %float
%v2bool = OpTypeVector %bool 2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%float_1 = OpConstant %float 1
%244 = OpTypeFunction %void
%main_inner = OpFunction %void None %31
%WorkGroupID = OpFunctionParameter %v3uint
%LocalInvocationID = OpFunctionParameter %v3uint
%local_invocation_index = OpFunctionParameter %uint
%37 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function %40
%r = OpVariable %_ptr_Function_uint Function %40
%c = OpVariable %_ptr_Function_uint Function %40
%loadIndex = OpVariable %_ptr_Function_v2uint Function %114
%r_0 = OpVariable %_ptr_Function_uint Function %40
%c_0 = OpVariable %_ptr_Function_uint Function %40
%writeIndex = OpVariable %_ptr_Function_v2uint Function %114
%acc = OpVariable %_ptr_Function_v3float Function %58
%f = OpVariable %_ptr_Function_uint Function %40
%i = OpVariable %_ptr_Function_uint Function %40
OpStore %idx %local_invocation_index
OpBranch %41
%41 = OpLabel
OpLoopMerge %42 %43 None
OpBranch %44
%44 = OpLabel
%46 = OpLoad %uint %idx
%48 = OpULessThan %bool %46 %uint_1024
%45 = OpLogicalNot %bool %48
OpSelectionMerge %50 None
OpBranchConditional %45 %51 %50
%51 = OpLabel
OpBranch %42
%50 = OpLabel
%52 = OpLoad %uint %idx
%53 = OpUDiv %uint %52 %uint_256
%54 = OpLoad %uint %idx
%55 = OpUMod %uint %54 %uint_256
%57 = OpAccessChain %_ptr_Workgroup_v3float %tile %53 %55
OpStore %57 %58
OpBranch %43
%43 = OpLabel
%59 = OpLoad %uint %idx
%61 = OpIAdd %uint %59 %uint_64
OpStore %idx %61
OpBranch %41
%42 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%67 = OpAccessChain %_ptr_Uniform_uint %params %uint_0
%68 = OpLoad %uint %67
%70 = OpISub %uint %68 %uint_1
%71 = OpUDiv %uint %70 %uint_2
%74 = OpLoad %16 %inputTex
%72 = OpImageQuerySizeLod %v2uint %74 %76
%77 = OpVectorShuffle %v2uint %WorkGroupID %WorkGroupID 0 1
%78 = OpAccessChain %_ptr_Uniform_uint %params %uint_1
%79 = OpLoad %uint %78
%80 = OpCompositeConstruct %v2uint %79 %uint_4
%81 = OpIMul %v2uint %77 %80
%82 = OpVectorShuffle %v2uint %LocalInvocationID %LocalInvocationID 0 1
%84 = OpIMul %v2uint %82 %83
%85 = OpIAdd %v2uint %81 %84
%86 = OpCompositeConstruct %v2uint %71 %40
%87 = OpISub %v2uint %85 %86
OpStore %r %40
OpBranch %89
%89 = OpLabel
OpLoopMerge %90 %91 None
OpBranch %92
%92 = OpLabel
%94 = OpLoad %uint %r
%95 = OpULessThan %bool %94 %uint_4
%93 = OpLogicalNot %bool %95
OpSelectionMerge %96 None
OpBranchConditional %93 %97 %96
%97 = OpLabel
OpBranch %90
%96 = OpLabel
OpStore %c %40
OpBranch %99
%99 = OpLabel
OpLoopMerge %100 %101 None
OpBranch %102
%102 = OpLabel
%104 = OpLoad %uint %c
%105 = OpULessThan %bool %104 %uint_4
%103 = OpLogicalNot %bool %105
OpSelectionMerge %106 None
OpBranchConditional %103 %107 %106
%107 = OpLabel
OpBranch %100
%106 = OpLabel
%108 = OpLoad %uint %c
%109 = OpLoad %uint %r
%110 = OpCompositeConstruct %v2uint %108 %109
%111 = OpIAdd %v2uint %87 %110
OpStore %loadIndex %111
%115 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0
%116 = OpLoad %uint %115
%117 = OpINotEqual %bool %116 %40
OpSelectionMerge %118 None
OpBranchConditional %117 %119 %118
%119 = OpLabel
%120 = OpLoad %v2uint %loadIndex
%121 = OpVectorShuffle %v2uint %120 %120 1 0
OpStore %loadIndex %121
OpBranch %118
%118 = OpLabel
%122 = OpLoad %uint %r
%123 = OpCompositeExtract %uint %LocalInvocationID 0
%124 = OpIMul %uint %uint_4 %123
%125 = OpLoad %uint %c
%126 = OpIAdd %uint %124 %125
%127 = OpAccessChain %_ptr_Workgroup_v3float %tile %122 %126
%130 = OpLoad %10 %samp
%131 = OpLoad %16 %inputTex
%133 = OpSampledImage %132 %131 %130
%136 = OpLoad %v2uint %loadIndex
%134 = OpConvertUToF %v2float %136
%139 = OpFAdd %v2float %134 %138
%140 = OpConvertUToF %v2float %72
%141 = OpFDiv %v2float %139 %140
%128 = OpImageSampleExplicitLod %v4float %133 %141 Lod %142
%143 = OpVectorShuffle %v3float %128 %128 0 1 2
OpStore %127 %143
OpBranch %101
%101 = OpLabel
%144 = OpLoad %uint %c
%145 = OpIAdd %uint %144 %uint_1
OpStore %c %145
OpBranch %99
%100 = OpLabel
OpBranch %91
%91 = OpLabel
%146 = OpLoad %uint %r
%147 = OpIAdd %uint %146 %uint_1
OpStore %r %147
OpBranch %89
%90 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %r_0 %40
OpBranch %150
%150 = OpLabel
OpLoopMerge %151 %152 None
OpBranch %153
%153 = OpLabel
%155 = OpLoad %uint %r_0
%156 = OpULessThan %bool %155 %uint_4
%154 = OpLogicalNot %bool %156
OpSelectionMerge %157 None
OpBranchConditional %154 %158 %157
%158 = OpLabel
OpBranch %151
%157 = OpLabel
OpStore %c_0 %40
OpBranch %160
%160 = OpLabel
OpLoopMerge %161 %162 None
OpBranch %163
%163 = OpLabel
%165 = OpLoad %uint %c_0
%166 = OpULessThan %bool %165 %uint_4
%164 = OpLogicalNot %bool %166
OpSelectionMerge %167 None
OpBranchConditional %164 %168 %167
%168 = OpLabel
OpBranch %161
%167 = OpLabel
%169 = OpLoad %uint %c_0
%170 = OpLoad %uint %r_0
%171 = OpCompositeConstruct %v2uint %169 %170
%172 = OpIAdd %v2uint %87 %171
OpStore %writeIndex %172
%174 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0
%175 = OpLoad %uint %174
%176 = OpINotEqual %bool %175 %40
OpSelectionMerge %177 None
OpBranchConditional %176 %178 %177
%178 = OpLabel
%179 = OpLoad %v2uint %writeIndex
%180 = OpVectorShuffle %v2uint %179 %179 1 0
OpStore %writeIndex %180
OpBranch %177
%177 = OpLabel
%181 = OpCompositeExtract %uint %LocalInvocationID 0
%182 = OpIMul %uint %uint_4 %181
%183 = OpLoad %uint %c_0
%184 = OpIAdd %uint %182 %183
%185 = OpUGreaterThanEqual %bool %184 %71
OpSelectionMerge %186 None
OpBranchConditional %185 %187 %186
%187 = OpLabel
%188 = OpISub %uint %uint_256 %71
%189 = OpULessThan %bool %184 %188
OpBranch %186
%186 = OpLabel
%190 = OpPhi %bool %185 %177 %189 %187
OpSelectionMerge %191 None
OpBranchConditional %190 %192 %191
%192 = OpLabel
%194 = OpLoad %v2uint %writeIndex
%195 = OpULessThan %v2bool %194 %72
%193 = OpAll %bool %195
OpBranch %191
%191 = OpLabel
%197 = OpPhi %bool %190 %186 %193 %192
OpSelectionMerge %198 None
OpBranchConditional %197 %199 %198
%199 = OpLabel
OpStore %acc %58
OpStore %f %40
OpBranch %203
%203 = OpLabel
OpLoopMerge %204 %205 None
OpBranch %206
%206 = OpLabel
%208 = OpLoad %uint %f
%209 = OpAccessChain %_ptr_Uniform_uint %params %uint_0
%210 = OpLoad %uint %209
%211 = OpULessThan %bool %208 %210
%207 = OpLogicalNot %bool %211
OpSelectionMerge %212 None
OpBranchConditional %207 %213 %212
%213 = OpLabel
OpBranch %204
%212 = OpLabel
%214 = OpLoad %uint %f
%215 = OpIAdd %uint %184 %214
%216 = OpISub %uint %215 %71
OpStore %i %216
%218 = OpLoad %v3float %acc
%221 = OpAccessChain %_ptr_Uniform_uint %params %uint_0
%222 = OpLoad %uint %221
%220 = OpConvertUToF %float %222
%223 = OpFDiv %float %float_1 %220
%224 = OpLoad %uint %r_0
%225 = OpLoad %uint %i
%226 = OpAccessChain %_ptr_Workgroup_v3float %tile %224 %225
%227 = OpLoad %v3float %226
%228 = OpVectorTimesScalar %v3float %227 %223
%229 = OpFAdd %v3float %218 %228
OpStore %acc %229
OpBranch %205
%205 = OpLabel
%230 = OpLoad %uint %f
%231 = OpIAdd %uint %230 %uint_1
OpStore %f %231
OpBranch %203
%204 = OpLabel
%233 = OpLoad %20 %outputTex
%234 = OpLoad %v2uint %writeIndex
%235 = OpLoad %v3float %acc
%236 = OpCompositeExtract %float %235 0
%237 = OpCompositeExtract %float %235 1
%238 = OpCompositeExtract %float %235 2
%239 = OpCompositeConstruct %v4float %236 %237 %238 %float_1
OpImageWrite %233 %234 %239
OpBranch %198
%198 = OpLabel
OpBranch %162
%162 = OpLabel
%240 = OpLoad %uint %c_0
%241 = OpIAdd %uint %240 %uint_1
OpStore %c_0 %241
OpBranch %160
%161 = OpLabel
OpBranch %152
%152 = OpLabel
%242 = OpLoad %uint %r_0
%243 = OpIAdd %uint %242 %uint_1
OpStore %r_0 %243
OpBranch %150
%151 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %244
%246 = OpLabel
%248 = OpLoad %v3uint %WorkGroupID_1
%249 = OpLoad %v3uint %LocalInvocationID_1
%250 = OpLoad %uint %local_invocation_index_1
%247 = OpFunctionCall %void %main_inner %248 %249 %250
OpReturn
OpFunctionEnd