| ; SPIR-V | |
| ; Version: 1.3 | |
| ; Generator: Google Tint Compiler; 1 | |
| ; Bound: 42 | |
| ; Schema: 0 | |
| OpCapability Shader | |
| OpMemoryModel Logical GLSL450 | |
| OpEntryPoint GLCompute %compute_main "compute_main" %compute_main_local_invocation_index_Input | |
| OpExecutionMode %compute_main LocalSize 1 1 1 | |
| OpName %wg "wg" | |
| OpName %compute_main_local_invocation_index_Input "compute_main_local_invocation_index_Input" | |
| OpName %compute_main_inner "compute_main_inner" | |
| OpName %tint_local_index "tint_local_index" | |
| OpName %idx "idx" | |
| OpName %compute_main "compute_main" | |
| OpDecorate %compute_main_local_invocation_index_Input BuiltIn LocalInvocationIndex | |
| %uint = OpTypeInt 32 0 | |
| %uint_4 = OpConstant %uint 4 | |
| %_arr_uint_uint_4 = OpTypeArray %uint %uint_4 | |
| %_ptr_Workgroup__arr_uint_uint_4 = OpTypePointer Workgroup %_arr_uint_uint_4 | |
| %wg = OpVariable %_ptr_Workgroup__arr_uint_uint_4 Workgroup | |
| %_ptr_Input_uint = OpTypePointer Input %uint | |
| %compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input | |
| %void = OpTypeVoid | |
| %11 = OpTypeFunction %void %uint | |
| %uint_2 = OpConstant %uint 2 | |
| %uint_264 = OpConstant %uint 264 | |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint | |
| %uint_1 = OpConstant %uint 1 | |
| %uint_0 = OpConstant %uint 0 | |
| %_ptr_Function_uint = OpTypePointer Function %uint | |
| %bool = OpTypeBool | |
| %38 = OpTypeFunction %void | |
| %compute_main_inner = OpFunction %void None %11 | |
| %tint_local_index = OpFunctionParameter %uint | |
| %12 = OpLabel | |
| %idx = OpVariable %_ptr_Function_uint Function | |
| OpBranch %13 | |
| %13 = OpLabel | |
| OpStore %idx %tint_local_index | |
| OpBranch %16 | |
| %16 = OpLabel | |
| OpLoopMerge %17 %15 None | |
| OpBranch %14 | |
| %14 = OpLabel | |
| %28 = OpLoad %uint %idx None | |
| %29 = OpUGreaterThanEqual %bool %28 %uint_4 | |
| OpSelectionMerge %31 None | |
| OpBranchConditional %29 %32 %31 | |
| %32 = OpLabel | |
| OpBranch %17 | |
| %31 = OpLabel | |
| %33 = OpAccessChain %_ptr_Workgroup_uint %wg %28 | |
| OpAtomicStore %33 %uint_2 %uint_0 %uint_0 | |
| OpBranch %15 | |
| %15 = OpLabel | |
| %35 = OpLoad %uint %idx None | |
| %36 = OpIAdd %uint %35 %uint_1 | |
| OpStore %idx %36 None | |
| OpBranch %16 | |
| %17 = OpLabel | |
| OpControlBarrier %uint_2 %uint_2 %uint_264 | |
| %21 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1 | |
| OpAtomicStore %21 %uint_2 %uint_0 %uint_1 | |
| OpReturn | |
| OpFunctionEnd | |
| %compute_main = OpFunction %void None %38 | |
| %39 = OpLabel | |
| %40 = OpLoad %uint %compute_main_local_invocation_index_Input None | |
| %41 = OpFunctionCall %void %compute_main_inner %40 | |
| OpReturn | |
| OpFunctionEnd |