blob: 022f17ec7c9f3b64774c1f11fc3b2114ffd7bdef [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 69
; 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"
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_26 "x_26"
OpName %compute_main_1 "compute_main_1"
OpName %x_47 "x_47"
OpName %compute_main_inner_0 "compute_main_inner"
OpName %local_invocation_index_1_param "local_invocation_index_1_param"
OpName %compute_main "compute_main"
OpDecorate %_arr_uint_uint_4 ArrayStride 4
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
%uint_4 = OpConstant %uint 4
%_arr_uint_uint_4 = OpTypeArray %uint %uint_4
%_ptr_Workgroup__arr_uint_uint_4 = OpTypePointer Workgroup %_arr_uint_uint_4
%wg = OpVariable %_ptr_Workgroup__arr_uint_uint_4 Workgroup
%_ptr_Input_uint = OpTypePointer Input %uint
%compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
%void = OpTypeVoid
%14 = OpTypeFunction %void %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%uint_0 = OpConstant %uint 0
%bool = OpTypeBool
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%uint_2 = OpConstant %uint 2
%uint_1 = OpConstant %uint 1
%uint_264 = OpConstant %uint 264
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%44 = OpTypeFunction %void
%compute_main_inner = OpFunction %void None %14
%local_invocation_index_2 = OpFunctionParameter %uint
%15 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function
OpStore %idx %uint_0
OpStore %idx %local_invocation_index_2 None
OpBranch %21
%21 = OpLabel
OpLoopMerge %22 %20 None
OpBranch %19
%19 = OpLabel
%23 = OpLoad %uint %idx None
%24 = OpULessThan %bool %23 %uint_4
%26 = OpLogicalNot %bool %24
OpSelectionMerge %27 None
OpBranchConditional %26 %28 %27
%28 = OpLabel
OpBranch %22
%27 = OpLabel
%x_26 = OpLoad %uint %idx None
%30 = OpAccessChain %_ptr_Workgroup_uint %wg %x_26
OpAtomicStore %30 %uint_2 %uint_0 %uint_0
OpBranch %20
%20 = OpLabel
%34 = OpLoad %uint %idx None
%35 = OpIAdd %uint %34 %uint_1
OpStore %idx %35 None
OpBranch %21
%22 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%39 = OpAccessChain %_ptr_Workgroup_uint %wg %int_1
OpAtomicStore %39 %uint_2 %uint_0 %uint_1
OpReturn
OpFunctionEnd
%compute_main_1 = OpFunction %void None %44
%45 = OpLabel
%x_47 = OpLoad %uint %local_invocation_index_1 None
%47 = OpFunctionCall %void %compute_main_inner %x_47
OpReturn
OpFunctionEnd
%compute_main_inner_0 = OpFunction %void None %14
%local_invocation_index_1_param = OpFunctionParameter %uint
%50 = OpLabel
OpBranch %51
%51 = OpLabel
OpBranch %54
%54 = OpLabel
%56 = OpPhi %uint %local_invocation_index_1_param %51 %57 %53
OpLoopMerge %55 %53 None
OpBranch %52
%52 = OpLabel
%58 = OpUGreaterThanEqual %bool %56 %uint_4
OpSelectionMerge %59 None
OpBranchConditional %58 %60 %59
%60 = OpLabel
OpBranch %55
%59 = OpLabel
%61 = OpAccessChain %_ptr_Workgroup_uint %wg %56
OpAtomicStore %61 %uint_2 %uint_0 %uint_0
OpBranch %53
%53 = OpLabel
%57 = OpIAdd %uint %56 %uint_1
OpBranch %54
%55 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %local_invocation_index_1 %local_invocation_index_1_param None
%64 = OpFunctionCall %void %compute_main_1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %44
%66 = OpLabel
%67 = OpLoad %uint %compute_main_local_invocation_index_Input None
%68 = OpFunctionCall %void %compute_main_inner_0 %67
OpReturn
OpFunctionEnd