blob: ec2dc67d772c0f66a9d304fbf85bc63e44e04f4d [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 70
; Schema: 0
OpCapability Shader
%31 = OpExtInstImport "GLSL.std.450"
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
%uint_3 = OpConstant %uint 3
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%uint_2 = OpConstant %uint 2
%uint_1 = OpConstant %uint 1
%uint_264 = OpConstant %uint 264
%45 = 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 = OpExtInst %uint %31 UMin %x_26 %uint_3
%33 = OpAccessChain %_ptr_Workgroup_uint %wg %30
OpAtomicStore %33 %uint_2 %uint_0 %uint_0
OpBranch %20
%20 = OpLabel
%37 = OpLoad %uint %idx None
%38 = OpIAdd %uint %37 %uint_1
OpStore %idx %38 None
OpBranch %21
%22 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%42 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
OpAtomicStore %42 %uint_2 %uint_0 %uint_1
OpReturn
OpFunctionEnd
%compute_main_1 = OpFunction %void None %45
%46 = OpLabel
%x_47 = OpLoad %uint %local_invocation_index_1 None
%48 = OpFunctionCall %void %compute_main_inner %x_47
OpReturn
OpFunctionEnd
%compute_main_inner_0 = OpFunction %void None %14
%local_invocation_index_1_param = OpFunctionParameter %uint
%51 = OpLabel
OpBranch %52
%52 = OpLabel
OpBranch %55
%55 = OpLabel
%57 = OpPhi %uint %local_invocation_index_1_param %52 %58 %54
OpLoopMerge %56 %54 None
OpBranch %53
%53 = OpLabel
%59 = OpUGreaterThanEqual %bool %57 %uint_4
OpSelectionMerge %60 None
OpBranchConditional %59 %61 %60
%61 = OpLabel
OpBranch %56
%60 = OpLabel
%62 = OpAccessChain %_ptr_Workgroup_uint %wg %57
OpAtomicStore %62 %uint_2 %uint_0 %uint_0
OpBranch %54
%54 = OpLabel
%58 = OpIAdd %uint %57 %uint_1
OpBranch %55
%56 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %local_invocation_index_1 %local_invocation_index_1_param None
%65 = OpFunctionCall %void %compute_main_1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %45
%67 = OpLabel
%68 = OpLoad %uint %compute_main_local_invocation_index_Input None
%69 = OpFunctionCall %void %compute_main_inner_0 %68
OpReturn
OpFunctionEnd