blob: f96a08f12e0a65e54e837982859ae5952cb67b64 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 77
; 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_28 "x_28"
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
OpMemberDecorate %S_atomic 1 Offset 4
OpMemberDecorate %S_atomic 2 Offset 8
OpDecorate %_arr_S_atomic_uint_10 ArrayStride 12
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
%S_atomic = OpTypeStruct %int %uint %uint
%uint_10 = OpConstant %uint 10
%_arr_S_atomic_uint_10 = OpTypeArray %S_atomic %uint_10
%_ptr_Workgroup__arr_S_atomic_uint_10 = OpTypePointer Workgroup %_arr_S_atomic_uint_10
%wg = OpVariable %_ptr_Workgroup__arr_S_atomic_uint_10 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
%bool = OpTypeBool
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%int_0 = OpConstant %int 0
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
%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
OpStore %idx %local_invocation_index_2 None
OpBranch %23
%23 = OpLabel
OpLoopMerge %24 %22 None
OpBranch %21
%21 = OpLabel
%25 = OpLoad %uint %idx None
%26 = OpULessThan %bool %25 %uint_10
%28 = OpLogicalNot %bool %26
OpSelectionMerge %29 None
OpBranchConditional %28 %30 %29
%30 = OpLabel
OpBranch %24
%29 = OpLabel
%x_28 = OpLoad %uint %idx None
%32 = OpAccessChain %_ptr_Workgroup_int %wg %x_28 %uint_0
OpStore %32 %int_0 None
%35 = OpAccessChain %_ptr_Workgroup_uint %wg %x_28 %uint_1
OpAtomicStore %35 %uint_2 %uint_0 %uint_0
%40 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %x_28 %uint_2
OpStore %40 %uint_0 None
OpBranch %22
%22 = OpLabel
%42 = OpLoad %uint %idx None
%43 = OpIAdd %uint %42 %uint_1
OpStore %idx %43 None
OpBranch %23
%24 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%46 = OpAccessChain %_ptr_Workgroup_uint %wg %int_4 %uint_1
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
OpBranch %57
%57 = OpLabel
OpBranch %60
%60 = OpLabel
%62 = OpPhi %uint %local_invocation_index_1_param %57 %63 %59
OpLoopMerge %61 %59 None
OpBranch %58
%58 = OpLabel
%64 = OpUGreaterThanEqual %bool %62 %uint_10
OpSelectionMerge %65 None
OpBranchConditional %64 %66 %65
%66 = OpLabel
OpBranch %61
%65 = OpLabel
%67 = OpAccessChain %_ptr_Workgroup_int %wg %62 %uint_0
OpStore %67 %int_0 None
%68 = OpAccessChain %_ptr_Workgroup_uint %wg %62 %uint_1
OpAtomicStore %68 %uint_2 %uint_0 %uint_0
%70 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %62 %uint_2
OpStore %70 %uint_0 None
OpBranch %59
%59 = OpLabel
%63 = OpIAdd %uint %62 %uint_1
OpBranch %60
%61 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %local_invocation_index_1 %local_invocation_index_1_param None
%72 = OpFunctionCall %void %compute_main_1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %50
%74 = OpLabel
%75 = OpLoad %uint %compute_main_local_invocation_index_Input None
%76 = OpFunctionCall %void %compute_main_inner_0 %75
OpReturn
OpFunctionEnd