| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 46 |
| ; 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 |
| %int = OpTypeInt 32 1 |
| %uint = OpTypeInt 32 0 |
| %uint_128 = OpConstant %uint 128 |
| %_arr_int_uint_128 = OpTypeArray %int %uint_128 |
| %_ptr_Workgroup__arr_int_uint_128 = OpTypePointer Workgroup %_arr_int_uint_128 |
| %v = OpVariable %_ptr_Workgroup__arr_int_uint_128 Workgroup |
| %_ptr_Input_uint = OpTypePointer Input %uint |
| %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input |
| %10 = OpTypeFunction %int |
| %_ptr_Workgroup_int = OpTypePointer Workgroup %int |
| %uint_0 = OpConstant %uint 0 |
| %void = OpTypeVoid |
| %uint_2 = OpConstant %uint 2 |
| %uint_264 = OpConstant %uint 264 |
| %23 = OpTypeFunction %void %uint |
| %bool = OpTypeBool |
| %int_0 = OpConstant %int 0 |
| %uint_1 = OpConstant %uint 1 |
| %42 = OpTypeFunction %void |
| %foo = OpFunction %int None %10 |
| %11 = OpLabel |
| %12 = OpAccessChain %_ptr_Workgroup_int %v %uint_0 |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| %19 = OpLoad %int %12 None |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| OpReturnValue %19 |
| OpFunctionEnd |
| %main_inner = OpFunction %void None %23 |
| %tint_local_index = OpFunctionParameter %uint |
| %24 = OpLabel |
| OpBranch %25 |
| %25 = OpLabel |
| OpBranch %28 |
| %28 = OpLabel |
| %30 = OpPhi %uint %tint_local_index %25 %31 %27 |
| OpLoopMerge %29 %27 None |
| OpBranch %26 |
| %26 = OpLabel |
| %34 = OpUGreaterThanEqual %bool %30 %uint_128 |
| OpSelectionMerge %36 None |
| OpBranchConditional %34 %37 %36 |
| %37 = OpLabel |
| OpBranch %29 |
| %36 = OpLabel |
| %38 = OpAccessChain %_ptr_Workgroup_int %v %30 |
| OpStore %38 %int_0 None |
| OpBranch %27 |
| %27 = OpLabel |
| %31 = OpIAdd %uint %30 %uint_1 |
| OpBranch %28 |
| %29 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| %33 = OpFunctionCall %int %foo |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %42 |
| %43 = OpLabel |
| %44 = OpLoad %uint %main_local_invocation_index_Input None |
| %45 = OpFunctionCall %void %main_inner %44 |
| OpReturn |
| OpFunctionEnd |