| ; 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 |
| %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 |
| %float = OpTypeFloat 32 |
| %float_1 = OpConstant %float 1 |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint |
| %uint_0 = OpConstant %uint 0 |
| %20 = 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 = OpBitcast %uint %float_1 |
| %15 = OpAccessChain %_ptr_Workgroup_uint %v %uint_0 |
| OpStore %15 %12 None |
| OpReturn |
| OpFunctionEnd |
| %main_inner = OpFunction %void None %20 |
| %tint_local_index = OpFunctionParameter %uint |
| %21 = OpLabel |
| OpBranch %22 |
| %22 = OpLabel |
| OpBranch %25 |
| %25 = OpLabel |
| %27 = OpPhi %uint %tint_local_index %22 %28 %24 |
| OpLoopMerge %26 %24 None |
| OpBranch %23 |
| %23 = OpLabel |
| %33 = OpUGreaterThanEqual %bool %27 %uint_16 |
| OpSelectionMerge %35 None |
| OpBranchConditional %33 %36 %35 |
| %36 = OpLabel |
| OpBranch %26 |
| %35 = OpLabel |
| %37 = OpIMul %uint %27 %uint_4 |
| %39 = OpUDiv %uint %37 %uint_4 |
| %40 = OpAccessChain %_ptr_Workgroup_uint %v %39 |
| OpStore %40 %uint_0 None |
| OpBranch %24 |
| %24 = OpLabel |
| %28 = OpIAdd %uint %27 %uint_1 |
| OpBranch %25 |
| %26 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| %32 = OpFunctionCall %void %foo |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %10 |
| %43 = OpLabel |
| %44 = OpLoad %uint %main_local_invocation_index_Input None |
| %45 = OpFunctionCall %void %main_inner %44 |
| OpReturn |
| OpFunctionEnd |