| ; SPIR-V | |
| ; Version: 1.3 | |
| ; Generator: Google Tint Compiler; 1 | |
| ; Bound: 47 | |
| ; 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 | |
| %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 | |
| %_ptr_Function_uint = OpTypePointer Function %uint | |
| %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 | |
| %idx = OpVariable %_ptr_Function_uint Function | |
| OpBranch %20 | |
| %20 = OpLabel | |
| OpStore %idx %tint_local_index | |
| OpBranch %23 | |
| %23 = OpLabel | |
| OpLoopMerge %24 %22 None | |
| OpBranch %21 | |
| %21 = OpLabel | |
| %31 = OpLoad %uint %idx None | |
| %32 = OpUGreaterThanEqual %bool %31 %uint_16 | |
| OpSelectionMerge %34 None | |
| OpBranchConditional %32 %35 %34 | |
| %35 = OpLabel | |
| OpBranch %24 | |
| %34 = OpLabel | |
| %36 = OpIMul %uint %31 %uint_4 | |
| %38 = OpUDiv %uint %36 %uint_4 | |
| %39 = OpAccessChain %_ptr_Workgroup_uint %v %38 | |
| OpStore %39 %uint_0 None | |
| OpBranch %22 | |
| %22 = OpLabel | |
| %40 = OpLoad %uint %idx None | |
| %41 = OpIAdd %uint %40 %uint_1 | |
| OpStore %idx %41 None | |
| OpBranch %23 | |
| %24 = OpLabel | |
| OpControlBarrier %uint_2 %uint_2 %uint_264 | |
| %28 = OpFunctionCall %void %foo | |
| OpReturn | |
| OpFunctionEnd | |
| %main = OpFunction %void None %10 | |
| %44 = OpLabel | |
| %45 = OpLoad %uint %main_local_invocation_index_Input None | |
| %46 = OpFunctionCall %void %main_inner %45 | |
| OpReturn | |
| OpFunctionEnd |