| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 266 |
| ; 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_block "params_block" |
| OpMemberName %params_block 0 "inner" |
| OpName %Params "Params" |
| OpMemberName %Params 0 "filterDim" |
| OpMemberName %Params 1 "blockDim" |
| OpName %params "params" |
| OpName %inputTex "inputTex" |
| OpName %outputTex "outputTex" |
| OpName %flip_block "flip_block" |
| OpMemberName %flip_block 0 "inner" |
| OpName %Flip "Flip" |
| OpMemberName %Flip 0 "value" |
| OpName %flip "flip" |
| OpName %tile "tile" |
| OpName %tint_zero_workgroup_memory "tint_zero_workgroup_memory" |
| OpName %local_idx "local_idx" |
| OpName %idx "idx" |
| OpName %tint_div "tint_div" |
| OpName %lhs "lhs" |
| OpName %rhs "rhs" |
| OpName %main_inner "main_inner" |
| OpName %WorkGroupID "WorkGroupID" |
| OpName %LocalInvocationID "LocalInvocationID" |
| OpName %local_invocation_index "local_invocation_index" |
| 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 Block |
| OpMemberDecorate %params_block 0 Offset 0 |
| 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 Block |
| OpMemberDecorate %flip_block 0 Offset 0 |
| 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 |
| %params_block = OpTypeStruct %Params |
| %_ptr_Uniform_params_block = OpTypePointer Uniform %params_block |
| %params = OpVariable %_ptr_Uniform_params_block Uniform |
| %float = OpTypeFloat 32 |
| %17 = OpTypeImage %float 2D 0 0 0 1 Unknown |
| %_ptr_UniformConstant_17 = OpTypePointer UniformConstant %17 |
| %inputTex = OpVariable %_ptr_UniformConstant_17 UniformConstant |
| %21 = OpTypeImage %float 2D 0 0 0 2 Rgba8 |
| %_ptr_UniformConstant_21 = OpTypePointer UniformConstant %21 |
| %outputTex = OpVariable %_ptr_UniformConstant_21 UniformConstant |
| %Flip = OpTypeStruct %uint |
| %flip_block = OpTypeStruct %Flip |
| %_ptr_Uniform_flip_block = OpTypePointer Uniform %flip_block |
| %flip = OpVariable %_ptr_Uniform_flip_block 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 |
| %33 = OpTypeFunction %void %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 |
| %65 = OpTypeFunction %uint %uint %uint |
| %uint_1 = OpConstant %uint 1 |
| %74 = OpTypeFunction %void %v3uint %v3uint %uint |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_Uniform_uint = OpTypePointer Uniform %uint |
| %v2uint = OpTypeVector %uint 2 |
| %int = OpTypeInt 32 1 |
| %91 = OpConstantNull %int |
| %98 = OpConstantComposite %v2uint %uint_4 %uint_1 |
| %_ptr_Function_v2uint = OpTypePointer Function %v2uint |
| %129 = OpConstantNull %v2uint |
| %v4float = OpTypeVector %float 4 |
| %147 = OpTypeSampledImage %17 |
| %v2float = OpTypeVector %float 2 |
| %float_0_25 = OpConstant %float 0.25 |
| %153 = OpConstantComposite %v2float %float_0_25 %float_0_25 |
| %157 = OpConstantNull %float |
| %v2bool = OpTypeVector %bool 2 |
| %_ptr_Function_v3float = OpTypePointer Function %v3float |
| %float_1 = OpConstant %float 1 |
| %259 = OpTypeFunction %void |
| %tint_zero_workgroup_memory = OpFunction %void None %33 |
| %local_idx = OpFunctionParameter %uint |
| %37 = OpLabel |
| %idx = OpVariable %_ptr_Function_uint Function %40 |
| OpStore %idx %local_idx |
| 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 |
| OpReturn |
| OpFunctionEnd |
| %tint_div = OpFunction %uint None %65 |
| %lhs = OpFunctionParameter %uint |
| %rhs = OpFunctionParameter %uint |
| %69 = OpLabel |
| %71 = OpIEqual %bool %rhs %40 |
| %70 = OpSelect %uint %71 %uint_1 %rhs |
| %73 = OpUDiv %uint %lhs %70 |
| OpReturnValue %73 |
| OpFunctionEnd |
| %main_inner = OpFunction %void None %74 |
| %WorkGroupID = OpFunctionParameter %v3uint |
| %LocalInvocationID = OpFunctionParameter %v3uint |
| %local_invocation_index = OpFunctionParameter %uint |
| %79 = OpLabel |
| %r = OpVariable %_ptr_Function_uint Function %40 |
| %c = OpVariable %_ptr_Function_uint Function %40 |
| %loadIndex = OpVariable %_ptr_Function_v2uint Function %129 |
| %r_0 = OpVariable %_ptr_Function_uint Function %40 |
| %c_0 = OpVariable %_ptr_Function_uint Function %40 |
| %writeIndex = OpVariable %_ptr_Function_v2uint Function %129 |
| %acc = OpVariable %_ptr_Function_v3float Function %58 |
| %f = OpVariable %_ptr_Function_uint Function %40 |
| %i = OpVariable %_ptr_Function_uint Function %40 |
| %80 = OpFunctionCall %void %tint_zero_workgroup_memory %local_invocation_index |
| %84 = OpAccessChain %_ptr_Uniform_uint %params %uint_0 %uint_0 |
| %85 = OpLoad %uint %84 |
| %86 = OpISub %uint %85 %uint_1 |
| %81 = OpFunctionCall %uint %tint_div %86 %uint_2 |
| %89 = OpLoad %17 %inputTex |
| %87 = OpImageQuerySizeLod %v2uint %89 %91 |
| %92 = OpVectorShuffle %v2uint %WorkGroupID %WorkGroupID 0 1 |
| %93 = OpAccessChain %_ptr_Uniform_uint %params %uint_0 %uint_1 |
| %94 = OpLoad %uint %93 |
| %95 = OpCompositeConstruct %v2uint %94 %uint_4 |
| %96 = OpIMul %v2uint %92 %95 |
| %97 = OpVectorShuffle %v2uint %LocalInvocationID %LocalInvocationID 0 1 |
| %99 = OpIMul %v2uint %97 %98 |
| %100 = OpIAdd %v2uint %96 %99 |
| %101 = OpCompositeConstruct %v2uint %81 %40 |
| %102 = OpISub %v2uint %100 %101 |
| OpStore %r %40 |
| OpBranch %104 |
| %104 = OpLabel |
| OpLoopMerge %105 %106 None |
| OpBranch %107 |
| %107 = OpLabel |
| %109 = OpLoad %uint %r |
| %110 = OpULessThan %bool %109 %uint_4 |
| %108 = OpLogicalNot %bool %110 |
| OpSelectionMerge %111 None |
| OpBranchConditional %108 %112 %111 |
| %112 = OpLabel |
| OpBranch %105 |
| %111 = OpLabel |
| OpStore %c %40 |
| OpBranch %114 |
| %114 = OpLabel |
| OpLoopMerge %115 %116 None |
| OpBranch %117 |
| %117 = OpLabel |
| %119 = OpLoad %uint %c |
| %120 = OpULessThan %bool %119 %uint_4 |
| %118 = OpLogicalNot %bool %120 |
| OpSelectionMerge %121 None |
| OpBranchConditional %118 %122 %121 |
| %122 = OpLabel |
| OpBranch %115 |
| %121 = OpLabel |
| %123 = OpLoad %uint %c |
| %124 = OpLoad %uint %r |
| %125 = OpCompositeConstruct %v2uint %123 %124 |
| %126 = OpIAdd %v2uint %102 %125 |
| OpStore %loadIndex %126 |
| %130 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0 %uint_0 |
| %131 = OpLoad %uint %130 |
| %132 = OpINotEqual %bool %131 %40 |
| OpSelectionMerge %133 None |
| OpBranchConditional %132 %134 %133 |
| %134 = OpLabel |
| %135 = OpLoad %v2uint %loadIndex |
| %136 = OpVectorShuffle %v2uint %135 %135 1 0 |
| OpStore %loadIndex %136 |
| OpBranch %133 |
| %133 = OpLabel |
| %137 = OpLoad %uint %r |
| %138 = OpCompositeExtract %uint %LocalInvocationID 0 |
| %139 = OpIMul %uint %uint_4 %138 |
| %140 = OpLoad %uint %c |
| %141 = OpIAdd %uint %139 %140 |
| %142 = OpAccessChain %_ptr_Workgroup_v3float %tile %137 %141 |
| %145 = OpLoad %10 %samp |
| %146 = OpLoad %17 %inputTex |
| %148 = OpSampledImage %147 %146 %145 |
| %151 = OpLoad %v2uint %loadIndex |
| %149 = OpConvertUToF %v2float %151 |
| %154 = OpFAdd %v2float %149 %153 |
| %155 = OpConvertUToF %v2float %87 |
| %156 = OpFDiv %v2float %154 %155 |
| %143 = OpImageSampleExplicitLod %v4float %148 %156 Lod %157 |
| %158 = OpVectorShuffle %v3float %143 %143 0 1 2 |
| OpStore %142 %158 |
| OpBranch %116 |
| %116 = OpLabel |
| %159 = OpLoad %uint %c |
| %160 = OpIAdd %uint %159 %uint_1 |
| OpStore %c %160 |
| OpBranch %114 |
| %115 = OpLabel |
| OpBranch %106 |
| %106 = OpLabel |
| %161 = OpLoad %uint %r |
| %162 = OpIAdd %uint %161 %uint_1 |
| OpStore %r %162 |
| OpBranch %104 |
| %105 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| OpStore %r_0 %40 |
| OpBranch %165 |
| %165 = OpLabel |
| OpLoopMerge %166 %167 None |
| OpBranch %168 |
| %168 = OpLabel |
| %170 = OpLoad %uint %r_0 |
| %171 = OpULessThan %bool %170 %uint_4 |
| %169 = OpLogicalNot %bool %171 |
| OpSelectionMerge %172 None |
| OpBranchConditional %169 %173 %172 |
| %173 = OpLabel |
| OpBranch %166 |
| %172 = OpLabel |
| OpStore %c_0 %40 |
| OpBranch %175 |
| %175 = OpLabel |
| OpLoopMerge %176 %177 None |
| OpBranch %178 |
| %178 = OpLabel |
| %180 = OpLoad %uint %c_0 |
| %181 = OpULessThan %bool %180 %uint_4 |
| %179 = OpLogicalNot %bool %181 |
| OpSelectionMerge %182 None |
| OpBranchConditional %179 %183 %182 |
| %183 = OpLabel |
| OpBranch %176 |
| %182 = OpLabel |
| %184 = OpLoad %uint %c_0 |
| %185 = OpLoad %uint %r_0 |
| %186 = OpCompositeConstruct %v2uint %184 %185 |
| %187 = OpIAdd %v2uint %102 %186 |
| OpStore %writeIndex %187 |
| %189 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0 %uint_0 |
| %190 = OpLoad %uint %189 |
| %191 = OpINotEqual %bool %190 %40 |
| OpSelectionMerge %192 None |
| OpBranchConditional %191 %193 %192 |
| %193 = OpLabel |
| %194 = OpLoad %v2uint %writeIndex |
| %195 = OpVectorShuffle %v2uint %194 %194 1 0 |
| OpStore %writeIndex %195 |
| OpBranch %192 |
| %192 = OpLabel |
| %196 = OpCompositeExtract %uint %LocalInvocationID 0 |
| %197 = OpIMul %uint %uint_4 %196 |
| %198 = OpLoad %uint %c_0 |
| %199 = OpIAdd %uint %197 %198 |
| %200 = OpUGreaterThanEqual %bool %199 %81 |
| OpSelectionMerge %201 None |
| OpBranchConditional %200 %202 %201 |
| %202 = OpLabel |
| %203 = OpISub %uint %uint_256 %81 |
| %204 = OpULessThan %bool %199 %203 |
| OpBranch %201 |
| %201 = OpLabel |
| %205 = OpPhi %bool %200 %192 %204 %202 |
| OpSelectionMerge %206 None |
| OpBranchConditional %205 %207 %206 |
| %207 = OpLabel |
| %209 = OpLoad %v2uint %writeIndex |
| %210 = OpULessThan %v2bool %209 %87 |
| %208 = OpAll %bool %210 |
| OpBranch %206 |
| %206 = OpLabel |
| %212 = OpPhi %bool %205 %201 %208 %207 |
| OpSelectionMerge %213 None |
| OpBranchConditional %212 %214 %213 |
| %214 = OpLabel |
| OpStore %acc %58 |
| OpStore %f %40 |
| OpBranch %218 |
| %218 = OpLabel |
| OpLoopMerge %219 %220 None |
| OpBranch %221 |
| %221 = OpLabel |
| %223 = OpLoad %uint %f |
| %224 = OpAccessChain %_ptr_Uniform_uint %params %uint_0 %uint_0 |
| %225 = OpLoad %uint %224 |
| %226 = OpULessThan %bool %223 %225 |
| %222 = OpLogicalNot %bool %226 |
| OpSelectionMerge %227 None |
| OpBranchConditional %222 %228 %227 |
| %228 = OpLabel |
| OpBranch %219 |
| %227 = OpLabel |
| %229 = OpLoad %uint %f |
| %230 = OpIAdd %uint %199 %229 |
| %231 = OpISub %uint %230 %81 |
| OpStore %i %231 |
| %233 = OpLoad %v3float %acc |
| %236 = OpAccessChain %_ptr_Uniform_uint %params %uint_0 %uint_0 |
| %237 = OpLoad %uint %236 |
| %235 = OpConvertUToF %float %237 |
| %238 = OpFDiv %float %float_1 %235 |
| %239 = OpLoad %uint %r_0 |
| %240 = OpLoad %uint %i |
| %241 = OpAccessChain %_ptr_Workgroup_v3float %tile %239 %240 |
| %242 = OpLoad %v3float %241 |
| %243 = OpVectorTimesScalar %v3float %242 %238 |
| %244 = OpFAdd %v3float %233 %243 |
| OpStore %acc %244 |
| OpBranch %220 |
| %220 = OpLabel |
| %245 = OpLoad %uint %f |
| %246 = OpIAdd %uint %245 %uint_1 |
| OpStore %f %246 |
| OpBranch %218 |
| %219 = OpLabel |
| %248 = OpLoad %21 %outputTex |
| %249 = OpLoad %v2uint %writeIndex |
| %250 = OpLoad %v3float %acc |
| %251 = OpCompositeExtract %float %250 0 |
| %252 = OpCompositeExtract %float %250 1 |
| %253 = OpCompositeExtract %float %250 2 |
| %254 = OpCompositeConstruct %v4float %251 %252 %253 %float_1 |
| OpImageWrite %248 %249 %254 |
| OpBranch %213 |
| %213 = OpLabel |
| OpBranch %177 |
| %177 = OpLabel |
| %255 = OpLoad %uint %c_0 |
| %256 = OpIAdd %uint %255 %uint_1 |
| OpStore %c_0 %256 |
| OpBranch %175 |
| %176 = OpLabel |
| OpBranch %167 |
| %167 = OpLabel |
| %257 = OpLoad %uint %r_0 |
| %258 = OpIAdd %uint %257 %uint_1 |
| OpStore %r_0 %258 |
| OpBranch %165 |
| %166 = OpLabel |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %259 |
| %261 = OpLabel |
| %263 = OpLoad %v3uint %WorkGroupID_1 |
| %264 = OpLoad %v3uint %LocalInvocationID_1 |
| %265 = OpLoad %uint %local_invocation_index_1 |
| %262 = OpFunctionCall %void %main_inner %263 %264 %265 |
| OpReturn |
| OpFunctionEnd |