blob: f3ed93eb9647e218dd3994e4e1c653af941ee3be [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 80
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %compute_main "compute_main" %compute_main_local_invocation_index_Input
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %local_invocation_index_1 "local_invocation_index_1"
OpMemberName %S_atomic 0 "x"
OpMemberName %S_atomic 1 "a"
OpMemberName %S_atomic 2 "y"
OpName %S_atomic "S_atomic"
OpName %wg "wg"
OpName %compute_main_local_invocation_index_Input "compute_main_local_invocation_index_Input"
OpName %compute_main_inner "compute_main_inner"
OpName %local_invocation_index_2 "local_invocation_index_2"
OpName %idx "idx"
OpName %x_35 "x_35"
OpName %compute_main_1 "compute_main_1"
OpName %x_53 "x_53"
OpName %compute_main_inner_0 "compute_main_inner"
OpName %local_invocation_index_1_param "local_invocation_index_1_param"
OpName %compute_main "compute_main"
OpMemberDecorate %S_atomic 0 Offset 0
OpDecorate %_arr_uint_uint_10 ArrayStride 4
OpMemberDecorate %S_atomic 1 Offset 4
OpMemberDecorate %S_atomic 2 Offset 44
OpDecorate %compute_main_local_invocation_index_Input BuiltIn LocalInvocationIndex
%uint = OpTypeInt 32 0
%_ptr_Private_uint = OpTypePointer Private %uint
%4 = OpConstantNull %uint
%local_invocation_index_1 = OpVariable %_ptr_Private_uint Private %4
%int = OpTypeInt 32 1
%uint_10 = OpConstant %uint 10
%_arr_uint_uint_10 = OpTypeArray %uint %uint_10
%S_atomic = OpTypeStruct %int %_arr_uint_uint_10 %uint
%_ptr_Workgroup_S_atomic = OpTypePointer Workgroup %S_atomic
%wg = OpVariable %_ptr_Workgroup_S_atomic Workgroup
%_ptr_Input_uint = OpTypePointer Input %uint
%compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
%void = OpTypeVoid
%16 = OpTypeFunction %void %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%uint_0 = OpConstant %uint 0
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%int_0 = OpConstant %int 0
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%uint_2 = OpConstant %uint 2
%bool = OpTypeBool
%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
%uint_1 = OpConstant %uint 1
%uint_264 = OpConstant %uint 264
%int_4 = OpConstant %int 4
%50 = OpTypeFunction %void
%compute_main_inner = OpFunction %void None %16
%local_invocation_index_2 = OpFunctionParameter %uint
%17 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function
OpStore %idx %uint_0
%21 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
OpStore %21 %int_0 None
%24 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
OpStore %24 %uint_0 None
OpStore %idx %local_invocation_index_2 None
OpBranch %29
%29 = OpLabel
OpLoopMerge %30 %28 None
OpBranch %27
%27 = OpLabel
%31 = OpLoad %uint %idx None
%32 = OpULessThan %bool %31 %uint_10
%34 = OpLogicalNot %bool %32
OpSelectionMerge %35 None
OpBranchConditional %34 %36 %35
%36 = OpLabel
OpBranch %30
%35 = OpLabel
%x_35 = OpLoad %uint %idx None
%38 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %x_35
OpAtomicStore %38 %uint_2 %uint_0 %uint_0
OpBranch %28
%28 = OpLabel
%42 = OpLoad %uint %idx None
%43 = OpIAdd %uint %42 %uint_1
OpStore %idx %43 None
OpBranch %29
%30 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%46 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %int_4
OpAtomicStore %46 %uint_2 %uint_0 %uint_1
OpReturn
OpFunctionEnd
%compute_main_1 = OpFunction %void None %50
%51 = OpLabel
%x_53 = OpLoad %uint %local_invocation_index_1 None
%53 = OpFunctionCall %void %compute_main_inner %x_53
OpReturn
OpFunctionEnd
%compute_main_inner_0 = OpFunction %void None %16
%local_invocation_index_1_param = OpFunctionParameter %uint
%56 = OpLabel
%57 = OpIEqual %bool %local_invocation_index_1_param %uint_0
OpSelectionMerge %58 None
OpBranchConditional %57 %59 %58
%59 = OpLabel
%60 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
OpStore %60 %int_0 None
%61 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
OpStore %61 %uint_0 None
OpBranch %58
%58 = OpLabel
OpBranch %62
%62 = OpLabel
OpBranch %65
%65 = OpLabel
%67 = OpPhi %uint %local_invocation_index_1_param %62 %68 %64
OpLoopMerge %66 %64 None
OpBranch %63
%63 = OpLabel
%69 = OpUGreaterThanEqual %bool %67 %uint_10
OpSelectionMerge %70 None
OpBranchConditional %69 %71 %70
%71 = OpLabel
OpBranch %66
%70 = OpLabel
%72 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %67
OpAtomicStore %72 %uint_2 %uint_0 %uint_0
OpBranch %64
%64 = OpLabel
%68 = OpIAdd %uint %67 %uint_1
OpBranch %65
%66 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %local_invocation_index_1 %local_invocation_index_1_param None
%75 = OpFunctionCall %void %compute_main_1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %50
%77 = OpLabel
%78 = OpLoad %uint %compute_main_local_invocation_index_Input None
%79 = OpFunctionCall %void %compute_main_inner_0 %78
OpReturn
OpFunctionEnd