| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 50 |
| ; 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 |
| OpMemberName %S 0 "x" |
| OpMemberName %S 1 "a" |
| OpMemberName %S 2 "y" |
| OpName %S "S" |
| 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 %compute_main "compute_main" |
| OpMemberDecorate %S 0 Offset 0 |
| OpDecorate %_arr_uint_uint_10 ArrayStride 4 |
| OpMemberDecorate %S 1 Offset 4 |
| OpMemberDecorate %S 2 Offset 44 |
| OpDecorate %compute_main_local_invocation_index_Input BuiltIn LocalInvocationIndex |
| %int = OpTypeInt 32 1 |
| %uint = OpTypeInt 32 0 |
| %uint_10 = OpConstant %uint 10 |
| %_arr_uint_uint_10 = OpTypeArray %uint %uint_10 |
| %S = OpTypeStruct %int %_arr_uint_uint_10 %uint |
| %_ptr_Workgroup_S = OpTypePointer Workgroup %S |
| %wg = OpVariable %_ptr_Workgroup_S Workgroup |
| %_ptr_Input_uint = OpTypePointer Input %uint |
| %compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input |
| %void = OpTypeVoid |
| %13 = OpTypeFunction %void %uint |
| %uint_0 = OpConstant %uint 0 |
| %bool = OpTypeBool |
| %_ptr_Workgroup_int = OpTypePointer Workgroup %int |
| %int_0 = OpConstant %int 0 |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint |
| %uint_2 = OpConstant %uint 2 |
| %_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint |
| %uint_1 = OpConstant %uint 1 |
| %uint_264 = OpConstant %uint 264 |
| %int_4 = OpConstant %int 4 |
| %46 = OpTypeFunction %void |
| %compute_main_inner = OpFunction %void None %13 |
| %tint_local_index = OpFunctionParameter %uint |
| %14 = OpLabel |
| %15 = OpIEqual %bool %tint_local_index %uint_0 |
| OpSelectionMerge %18 None |
| OpBranchConditional %15 %19 %18 |
| %19 = OpLabel |
| %20 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0 |
| OpStore %20 %int_0 None |
| %23 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2 |
| OpStore %23 %uint_0 None |
| OpBranch %18 |
| %18 = OpLabel |
| OpBranch %26 |
| %26 = OpLabel |
| OpBranch %29 |
| %29 = OpLabel |
| %31 = OpPhi %uint %tint_local_index %26 %32 %28 |
| OpLoopMerge %30 %28 None |
| OpBranch %27 |
| %27 = OpLabel |
| %33 = OpUGreaterThanEqual %bool %31 %uint_10 |
| OpSelectionMerge %34 None |
| OpBranchConditional %33 %35 %34 |
| %35 = OpLabel |
| OpBranch %30 |
| %34 = OpLabel |
| %36 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %31 |
| OpAtomicStore %36 %uint_2 %uint_0 %uint_0 |
| OpBranch %28 |
| %28 = OpLabel |
| %32 = OpIAdd %uint %31 %uint_1 |
| OpBranch %29 |
| %30 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| %42 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %int_4 |
| OpAtomicStore %42 %uint_2 %uint_0 %uint_1 |
| OpReturn |
| OpFunctionEnd |
| %compute_main = OpFunction %void None %46 |
| %47 = OpLabel |
| %48 = OpLoad %uint %compute_main_local_invocation_index_Input None |
| %49 = OpFunctionCall %void %compute_main_inner %48 |
| OpReturn |
| OpFunctionEnd |