| ; SPIR-V | |
| ; Version: 1.3 | |
| ; Generator: Google Tint Compiler; 1 | |
| ; Bound: 53 | |
| ; Schema: 0 | |
| OpCapability Shader | |
| %16 = OpExtInstImport "GLSL.std.450" | |
| 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 | |
| %uint_4 = OpConstant %uint 4 | |
| %uint_1 = OpConstant %uint 1 | |
| %uint_0 = OpConstant %uint 0 | |
| %uint_8 = OpConstant %uint 8 | |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint | |
| %uint_1065353216 = OpConstant %uint 1065353216 | |
| %26 = OpTypeFunction %void %uint | |
| %uint_2 = OpConstant %uint 2 | |
| %uint_264 = OpConstant %uint 264 | |
| %_ptr_Function_uint = OpTypePointer Function %uint | |
| %bool = OpTypeBool | |
| %foo = OpFunction %void None %10 | |
| %11 = OpLabel | |
| %12 = OpISub %uint %uint_4 %uint_1 | |
| %15 = OpExtInst %uint %16 UMin %uint_0 %12 | |
| %18 = OpIMul %uint %15 %uint_8 | |
| %20 = OpUDiv %uint %18 %uint_4 | |
| %21 = OpAccessChain %_ptr_Workgroup_uint %v %20 | |
| OpStore %21 %uint_1065353216 None | |
| OpReturn | |
| OpFunctionEnd | |
| %main_inner = OpFunction %void None %26 | |
| %tint_local_index = OpFunctionParameter %uint | |
| %27 = OpLabel | |
| %idx = OpVariable %_ptr_Function_uint Function | |
| OpBranch %28 | |
| %28 = OpLabel | |
| OpStore %idx %tint_local_index | |
| OpBranch %31 | |
| %31 = OpLabel | |
| OpLoopMerge %32 %30 None | |
| OpBranch %29 | |
| %29 = OpLabel | |
| %39 = OpLoad %uint %idx None | |
| %40 = OpUGreaterThanEqual %bool %39 %uint_16 | |
| OpSelectionMerge %42 None | |
| OpBranchConditional %40 %43 %42 | |
| %43 = OpLabel | |
| OpBranch %32 | |
| %42 = OpLabel | |
| %44 = OpIMul %uint %39 %uint_4 | |
| %45 = OpUDiv %uint %44 %uint_4 | |
| %46 = OpAccessChain %_ptr_Workgroup_uint %v %45 | |
| OpStore %46 %uint_0 None | |
| OpBranch %30 | |
| %30 = OpLabel | |
| %47 = OpLoad %uint %idx None | |
| %48 = OpIAdd %uint %47 %uint_1 | |
| OpStore %idx %48 None | |
| OpBranch %31 | |
| %32 = OpLabel | |
| OpControlBarrier %uint_2 %uint_2 %uint_264 | |
| %36 = OpFunctionCall %void %foo | |
| OpReturn | |
| OpFunctionEnd | |
| %main = OpFunction %void None %10 | |
| %50 = OpLabel | |
| %51 = OpLoad %uint %main_local_invocation_index_Input None | |
| %52 = OpFunctionCall %void %main_inner %51 | |
| OpReturn | |
| OpFunctionEnd |