| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 66 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %f "f" %local_invocation_index_1 |
| OpExecutionMode %f LocalSize 1 1 1 |
| OpName %local_invocation_index_1 "local_invocation_index_1" |
| OpName %ubo_block "ubo_block" |
| OpMemberName %ubo_block 0 "inner" |
| OpName %UBO "UBO" |
| OpMemberName %UBO 0 "dynamic_idx" |
| OpName %ubo "ubo" |
| OpName %result_block "result_block" |
| OpMemberName %result_block 0 "inner" |
| OpName %Result "Result" |
| OpMemberName %Result 0 "out" |
| OpName %result "result" |
| OpName %S "S" |
| OpMemberName %S 0 "data" |
| OpName %s "s" |
| OpName %tint_zero_workgroup_memory "tint_zero_workgroup_memory" |
| OpName %local_idx "local_idx" |
| OpName %idx "idx" |
| OpName %f_inner "f_inner" |
| OpName %local_invocation_index "local_invocation_index" |
| OpName %f "f" |
| OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex |
| OpDecorate %ubo_block Block |
| OpMemberDecorate %ubo_block 0 Offset 0 |
| OpMemberDecorate %UBO 0 Offset 0 |
| OpDecorate %ubo NonWritable |
| OpDecorate %ubo DescriptorSet 0 |
| OpDecorate %ubo Binding 0 |
| OpDecorate %result_block Block |
| OpMemberDecorate %result_block 0 Offset 0 |
| OpMemberDecorate %Result 0 Offset 0 |
| OpDecorate %result DescriptorSet 0 |
| OpDecorate %result Binding 1 |
| OpMemberDecorate %S 0 Offset 0 |
| OpDecorate %_arr_int_uint_64 ArrayStride 4 |
| %uint = OpTypeInt 32 0 |
| %_ptr_Input_uint = OpTypePointer Input %uint |
| %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input |
| %int = OpTypeInt 32 1 |
| %UBO = OpTypeStruct %int |
| %ubo_block = OpTypeStruct %UBO |
| %_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block |
| %ubo = OpVariable %_ptr_Uniform_ubo_block Uniform |
| %Result = OpTypeStruct %int |
| %result_block = OpTypeStruct %Result |
| %_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block |
| %result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer |
| %uint_64 = OpConstant %uint 64 |
| %_arr_int_uint_64 = OpTypeArray %int %uint_64 |
| %S = OpTypeStruct %_arr_int_uint_64 |
| %_ptr_Workgroup_S = OpTypePointer Workgroup %S |
| %s = OpVariable %_ptr_Workgroup_S Workgroup |
| %void = OpTypeVoid |
| %18 = OpTypeFunction %void %uint |
| %_ptr_Function_uint = OpTypePointer Function %uint |
| %25 = OpConstantNull %uint |
| %bool = OpTypeBool |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_Workgroup_int = OpTypePointer Workgroup %int |
| %40 = OpConstantNull %int |
| %uint_1 = OpConstant %uint 1 |
| %uint_2 = OpConstant %uint 2 |
| %uint_264 = OpConstant %uint 264 |
| %_ptr_Uniform_int = OpTypePointer Uniform %int |
| %int_1 = OpConstant %int 1 |
| %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| %int_3 = OpConstant %int 3 |
| %61 = OpTypeFunction %void |
| %tint_zero_workgroup_memory = OpFunction %void None %18 |
| %local_idx = OpFunctionParameter %uint |
| %22 = OpLabel |
| %idx = OpVariable %_ptr_Function_uint Function %25 |
| OpStore %idx %local_idx |
| OpBranch %26 |
| %26 = OpLabel |
| OpLoopMerge %27 %28 None |
| OpBranch %29 |
| %29 = OpLabel |
| %31 = OpLoad %uint %idx |
| %32 = OpULessThan %bool %31 %uint_64 |
| %30 = OpLogicalNot %bool %32 |
| OpSelectionMerge %34 None |
| OpBranchConditional %30 %35 %34 |
| %35 = OpLabel |
| OpBranch %27 |
| %34 = OpLabel |
| %36 = OpLoad %uint %idx |
| %39 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %36 |
| OpStore %39 %40 |
| OpBranch %28 |
| %28 = OpLabel |
| %41 = OpLoad %uint %idx |
| %43 = OpIAdd %uint %41 %uint_1 |
| OpStore %idx %43 |
| OpBranch %26 |
| %27 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| OpReturn |
| OpFunctionEnd |
| %f_inner = OpFunction %void None %18 |
| %local_invocation_index = OpFunctionParameter %uint |
| %49 = OpLabel |
| %50 = OpFunctionCall %void %tint_zero_workgroup_memory %local_invocation_index |
| %52 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0 |
| %53 = OpLoad %int %52 |
| %54 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %53 |
| OpStore %54 %int_1 |
| %57 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0 |
| %59 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %int_3 |
| %60 = OpLoad %int %59 |
| OpStore %57 %60 |
| OpReturn |
| OpFunctionEnd |
| %f = OpFunction %void None %61 |
| %63 = OpLabel |
| %65 = OpLoad %uint %local_invocation_index_1 |
| %64 = OpFunctionCall %void %f_inner %65 |
| OpReturn |
| OpFunctionEnd |