| ; SPIR-V | |
| ; Version: 1.3 | |
| ; Generator: Google Tint Compiler; 1 | |
| ; Bound: 49 | |
| ; 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 %idx "idx" | |
| 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 | |
| %_ptr_Function_uint = OpTypePointer Function %uint | |
| %bool = OpTypeBool | |
| %int_0 = OpConstant %int 0 | |
| %uint_1 = OpConstant %uint 1 | |
| %45 = 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 | |
| %idx = OpVariable %_ptr_Function_uint Function | |
| OpBranch %25 | |
| %25 = OpLabel | |
| OpStore %idx %tint_local_index | |
| OpBranch %28 | |
| %28 = OpLabel | |
| OpLoopMerge %29 %27 None | |
| OpBranch %26 | |
| %26 = OpLabel | |
| %34 = OpLoad %uint %idx None | |
| %35 = OpUGreaterThanEqual %bool %34 %uint_128 | |
| OpSelectionMerge %37 None | |
| OpBranchConditional %35 %38 %37 | |
| %38 = OpLabel | |
| OpBranch %29 | |
| %37 = OpLabel | |
| %39 = OpAccessChain %_ptr_Workgroup_int %v %34 | |
| OpStore %39 %int_0 None | |
| OpBranch %27 | |
| %27 = OpLabel | |
| %41 = OpLoad %uint %idx None | |
| %42 = OpIAdd %uint %41 %uint_1 | |
| OpStore %idx %42 None | |
| OpBranch %28 | |
| %29 = OpLabel | |
| OpControlBarrier %uint_2 %uint_2 %uint_264 | |
| %31 = OpFunctionCall %int %foo | |
| OpReturn | |
| OpFunctionEnd | |
| %main = OpFunction %void None %45 | |
| %46 = OpLabel | |
| %47 = OpLoad %uint %main_local_invocation_index_Input None | |
| %48 = OpFunctionCall %void %main_inner %47 | |
| OpReturn | |
| OpFunctionEnd |