| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 44 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %main "main" %main_local_invocation_index_Input |
| OpExecutionMode %main LocalSize 1 1 1 |
| OpName %v "v" |
| OpName %main_local_invocation_index_Input "main_local_invocation_index_Input" |
| OpName %foo "foo" |
| OpName %main_inner "main_inner" |
| OpName %tint_local_index "tint_local_index" |
| OpName %main "main" |
| OpDecorate %main_local_invocation_index_Input BuiltIn LocalInvocationIndex |
| %uint = OpTypeInt 32 0 |
| %uint_16 = OpConstant %uint 16 |
| %_arr_uint_uint_16 = OpTypeArray %uint %uint_16 |
| %_ptr_Workgroup__arr_uint_uint_16 = OpTypePointer Workgroup %_arr_uint_uint_16 |
| %v = OpVariable %_ptr_Workgroup__arr_uint_uint_16 Workgroup |
| %_ptr_Input_uint = OpTypePointer Input %uint |
| %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input |
| %void = OpTypeVoid |
| %10 = OpTypeFunction %void |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint |
| %uint_0 = OpConstant %uint 0 |
| %uint_1065353216 = OpConstant %uint 1065353216 |
| %18 = OpTypeFunction %void %uint |
| %uint_2 = OpConstant %uint 2 |
| %uint_264 = OpConstant %uint 264 |
| %bool = OpTypeBool |
| %uint_4 = OpConstant %uint 4 |
| %uint_1 = OpConstant %uint 1 |
| %foo = OpFunction %void None %10 |
| %11 = OpLabel |
| %12 = OpAccessChain %_ptr_Workgroup_uint %v %uint_0 |
| OpStore %12 %uint_1065353216 None |
| OpReturn |
| OpFunctionEnd |
| %main_inner = OpFunction %void None %18 |
| %tint_local_index = OpFunctionParameter %uint |
| %19 = OpLabel |
| OpBranch %20 |
| %20 = OpLabel |
| OpBranch %23 |
| %23 = OpLabel |
| %25 = OpPhi %uint %tint_local_index %20 %26 %22 |
| OpLoopMerge %24 %22 None |
| OpBranch %21 |
| %21 = OpLabel |
| %31 = OpUGreaterThanEqual %bool %25 %uint_16 |
| OpSelectionMerge %33 None |
| OpBranchConditional %31 %34 %33 |
| %34 = OpLabel |
| OpBranch %24 |
| %33 = OpLabel |
| %35 = OpIMul %uint %25 %uint_4 |
| %37 = OpUDiv %uint %35 %uint_4 |
| %38 = OpAccessChain %_ptr_Workgroup_uint %v %37 |
| OpStore %38 %uint_0 None |
| OpBranch %22 |
| %22 = OpLabel |
| %26 = OpIAdd %uint %25 %uint_1 |
| OpBranch %23 |
| %24 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| %30 = OpFunctionCall %void %foo |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %10 |
| %41 = OpLabel |
| %42 = OpLoad %uint %main_local_invocation_index_Input None |
| %43 = OpFunctionCall %void %main_inner %42 |
| OpReturn |
| OpFunctionEnd |