| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 105 |
| ; Schema: 0 |
| OpCapability Shader |
| %46 = OpExtInstImport "GLSL.std.450" |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %compute_main "compute_main" %compute_main_local_invocation_index_Input |
| OpExecutionMode %compute_main LocalSize 1 1 1 |
| OpName %local_invocation_index_1 "local_invocation_index_1" |
| OpMemberName %S_atomic 0 "x" |
| OpMemberName %S_atomic 1 "a" |
| OpMemberName %S_atomic 2 "y" |
| OpName %S_atomic "S_atomic" |
| OpName %wg "wg" |
| OpName %compute_main_local_invocation_index_Input "compute_main_local_invocation_index_Input" |
| OpName %compute_main_inner "compute_main_inner" |
| OpName %local_invocation_index_2 "local_invocation_index_2" |
| OpName %idx "idx" |
| OpName %tint_loop_idx "tint_loop_idx" |
| OpName %x_28 "x_28" |
| OpName %tint_low_inc "tint_low_inc" |
| OpName %tint_carry "tint_carry" |
| OpName %compute_main_1 "compute_main_1" |
| OpName %x_53 "x_53" |
| OpName %compute_main_inner_0 "compute_main_inner" |
| OpName %local_invocation_index_1_param "local_invocation_index_1_param" |
| OpName %compute_main "compute_main" |
| OpMemberDecorate %S_atomic 0 Offset 0 |
| OpMemberDecorate %S_atomic 1 Offset 4 |
| OpMemberDecorate %S_atomic 2 Offset 8 |
| OpDecorate %_arr_S_atomic_uint_10 ArrayStride 12 |
| OpDecorate %compute_main_local_invocation_index_Input BuiltIn LocalInvocationIndex |
| %uint = OpTypeInt 32 0 |
| %_ptr_Private_uint = OpTypePointer Private %uint |
| %4 = OpConstantNull %uint |
| %local_invocation_index_1 = OpVariable %_ptr_Private_uint Private %4 |
| %int = OpTypeInt 32 1 |
| %S_atomic = OpTypeStruct %int %uint %uint |
| %uint_10 = OpConstant %uint 10 |
| %_arr_S_atomic_uint_10 = OpTypeArray %S_atomic %uint_10 |
| %_ptr_Workgroup__arr_S_atomic_uint_10 = OpTypePointer Workgroup %_arr_S_atomic_uint_10 |
| %wg = OpVariable %_ptr_Workgroup__arr_S_atomic_uint_10 Workgroup |
| %_ptr_Input_uint = OpTypePointer Input %uint |
| %compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input |
| %void = OpTypeVoid |
| %16 = OpTypeFunction %void %uint |
| %_ptr_Function_uint = OpTypePointer Function %uint |
| %uint_0 = OpConstant %uint 0 |
| %v2uint = OpTypeVector %uint 2 |
| %_ptr_Function_v2uint = OpTypePointer Function %v2uint |
| %29 = OpConstantNull %v2uint |
| %uint_4294967295 = OpConstant %uint 4294967295 |
| %32 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295 |
| %bool = OpTypeBool |
| %v2bool = OpTypeVector %bool 2 |
| %uint_9 = OpConstant %uint 9 |
| %_ptr_Workgroup_int = OpTypePointer Workgroup %int |
| %int_0 = OpConstant %int 0 |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint |
| %uint_1 = OpConstant %uint 1 |
| %uint_2 = OpConstant %uint 2 |
| %_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint |
| %uint_264 = OpConstant %uint 264 |
| %uint_4 = OpConstant %uint 4 |
| %78 = OpTypeFunction %void |
| %compute_main_inner = OpFunction %void None %16 |
| %local_invocation_index_2 = OpFunctionParameter %uint |
| %17 = OpLabel |
| %idx = OpVariable %_ptr_Function_uint Function |
| %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function %29 |
| OpStore %idx %uint_0 |
| OpStore %idx %local_invocation_index_2 None |
| OpBranch %21 |
| %21 = OpLabel |
| OpBranch %24 |
| %24 = OpLabel |
| OpLoopMerge %25 %23 None |
| OpBranch %22 |
| %22 = OpLabel |
| %30 = OpLoad %v2uint %tint_loop_idx None |
| %31 = OpIEqual %v2bool %30 %32 |
| %36 = OpAll %bool %31 |
| OpSelectionMerge %37 None |
| OpBranchConditional %36 %38 %37 |
| %38 = OpLabel |
| OpBranch %25 |
| %37 = OpLabel |
| %39 = OpLoad %uint %idx None |
| %40 = OpULessThan %bool %39 %uint_10 |
| %41 = OpLogicalNot %bool %40 |
| OpSelectionMerge %42 None |
| OpBranchConditional %41 %43 %42 |
| %43 = OpLabel |
| OpBranch %25 |
| %42 = OpLabel |
| %x_28 = OpLoad %uint %idx None |
| %45 = OpExtInst %uint %46 UMin %x_28 %uint_9 |
| %48 = OpAccessChain %_ptr_Workgroup_int %wg %45 %uint_0 |
| OpStore %48 %int_0 None |
| %51 = OpExtInst %uint %46 UMin %x_28 %uint_9 |
| %52 = OpAccessChain %_ptr_Workgroup_uint %wg %51 %uint_1 |
| OpAtomicStore %52 %uint_2 %uint_0 %uint_0 |
| %57 = OpExtInst %uint %46 UMin %x_28 %uint_9 |
| %58 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %57 %uint_2 |
| OpStore %58 %uint_0 None |
| OpBranch %23 |
| %23 = OpLabel |
| %60 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0 |
| %61 = OpLoad %uint %60 None |
| %tint_low_inc = OpIAdd %uint %61 %uint_1 |
| %63 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0 |
| OpStore %63 %tint_low_inc None |
| %64 = OpIEqual %bool %tint_low_inc %uint_0 |
| %tint_carry = OpSelect %uint %64 %uint_1 %uint_0 |
| %66 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1 |
| %67 = OpLoad %uint %66 None |
| %68 = OpIAdd %uint %67 %tint_carry |
| %69 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1 |
| OpStore %69 %68 None |
| %70 = OpLoad %uint %idx None |
| %71 = OpIAdd %uint %70 %uint_1 |
| OpStore %idx %71 None |
| OpBranch %24 |
| %25 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| %74 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_4 %uint_1 |
| OpAtomicStore %74 %uint_2 %uint_0 %uint_1 |
| OpReturn |
| OpFunctionEnd |
| %compute_main_1 = OpFunction %void None %78 |
| %79 = OpLabel |
| %x_53 = OpLoad %uint %local_invocation_index_1 None |
| %81 = OpFunctionCall %void %compute_main_inner %x_53 |
| OpReturn |
| OpFunctionEnd |
| %compute_main_inner_0 = OpFunction %void None %16 |
| %local_invocation_index_1_param = OpFunctionParameter %uint |
| %84 = OpLabel |
| OpBranch %85 |
| %85 = OpLabel |
| OpBranch %88 |
| %88 = OpLabel |
| %90 = OpPhi %uint %local_invocation_index_1_param %85 %91 %87 |
| OpLoopMerge %89 %87 None |
| OpBranch %86 |
| %86 = OpLabel |
| %92 = OpUGreaterThanEqual %bool %90 %uint_10 |
| OpSelectionMerge %93 None |
| OpBranchConditional %92 %94 %93 |
| %94 = OpLabel |
| OpBranch %89 |
| %93 = OpLabel |
| %95 = OpAccessChain %_ptr_Workgroup_int %wg %90 %uint_0 |
| OpStore %95 %int_0 None |
| %96 = OpAccessChain %_ptr_Workgroup_uint %wg %90 %uint_1 |
| OpAtomicStore %96 %uint_2 %uint_0 %uint_0 |
| %98 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %90 %uint_2 |
| OpStore %98 %uint_0 None |
| OpBranch %87 |
| %87 = OpLabel |
| %91 = OpIAdd %uint %90 %uint_1 |
| OpBranch %88 |
| %89 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| OpStore %local_invocation_index_1 %local_invocation_index_1_param None |
| %100 = OpFunctionCall %void %compute_main_1 |
| OpReturn |
| OpFunctionEnd |
| %compute_main = OpFunction %void None %78 |
| %102 = OpLabel |
| %103 = OpLoad %uint %compute_main_local_invocation_index_Input None |
| %104 = OpFunctionCall %void %compute_main_inner_0 %103 |
| OpReturn |
| OpFunctionEnd |