| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 48 |
| ; 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" |
| OpMemberName %out_block 0 "inner" |
| OpName %out_block "out_block" |
| 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" |
| OpMemberDecorate %out_block 0 Offset 0 |
| OpDecorate %out_block Block |
| OpDecorate %6 DescriptorSet 0 |
| OpDecorate %6 Binding 0 |
| OpDecorate %6 Coherent |
| 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 |
| %out_block = OpTypeStruct %uint |
| %_ptr_StorageBuffer_out_block = OpTypePointer StorageBuffer %out_block |
| %6 = OpVariable %_ptr_StorageBuffer_out_block StorageBuffer |
| %_ptr_Input_uint = OpTypePointer Input %uint |
| %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input |
| %void = OpTypeVoid |
| %13 = OpTypeFunction %void |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint |
| %uint_0 = OpConstant %uint 0 |
| %uint_64 = OpConstant %uint 64 |
| %21 = OpTypeFunction %void %uint |
| %uint_2 = OpConstant %uint 2 |
| %uint_264 = OpConstant %uint 264 |
| %bool = OpTypeBool |
| %uint_4 = OpConstant %uint 4 |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint |
| %uint_1 = OpConstant %uint 1 |
| %foo = OpFunction %void None %13 |
| %14 = OpLabel |
| %15 = OpAccessChain %_ptr_StorageBuffer_uint %6 %uint_0 |
| OpStore %15 %uint_64 None |
| OpReturn |
| OpFunctionEnd |
| %main_inner = OpFunction %void None %21 |
| %tint_local_index = OpFunctionParameter %uint |
| %22 = OpLabel |
| OpBranch %23 |
| %23 = OpLabel |
| OpBranch %26 |
| %26 = OpLabel |
| %28 = OpPhi %uint %tint_local_index %23 %29 %25 |
| OpLoopMerge %27 %25 None |
| OpBranch %24 |
| %24 = OpLabel |
| %34 = OpUGreaterThanEqual %bool %28 %uint_16 |
| OpSelectionMerge %36 None |
| OpBranchConditional %34 %37 %36 |
| %37 = OpLabel |
| OpBranch %27 |
| %36 = OpLabel |
| %38 = OpIMul %uint %28 %uint_4 |
| %40 = OpUDiv %uint %38 %uint_4 |
| %41 = OpAccessChain %_ptr_Workgroup_uint %v %40 |
| OpStore %41 %uint_0 None |
| OpBranch %25 |
| %25 = OpLabel |
| %29 = OpIAdd %uint %28 %uint_1 |
| OpBranch %26 |
| %27 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| %33 = OpFunctionCall %void %foo |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %13 |
| %45 = OpLabel |
| %46 = OpLoad %uint %main_local_invocation_index_Input None |
| %47 = OpFunctionCall %void %main_inner %46 |
| OpReturn |
| OpFunctionEnd |