blob: 6bfef89ac7e184912eea75d15c41834ecd45aaf9 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 87
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %compute_main "compute_main" %local_invocation_index_1_param_1
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %local_invocation_index_1_param_1 "local_invocation_index_1_param_1"
OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %S_atomic "S_atomic"
OpMemberName %S_atomic 0 "x"
OpMemberName %S_atomic 1 "a"
OpMemberName %S_atomic 2 "y"
OpName %wg "wg"
OpName %tint_zero_workgroup_memory "tint_zero_workgroup_memory"
OpName %local_idx "local_idx"
OpName %idx_1 "idx_1"
OpName %compute_main_inner "compute_main_inner"
OpName %local_invocation_index_2 "local_invocation_index_2"
OpName %idx "idx"
OpName %compute_main_1 "compute_main_1"
OpName %compute_main_inner_1 "compute_main_inner_1"
OpName %local_invocation_index_1_param "local_invocation_index_1_param"
OpName %compute_main "compute_main"
OpDecorate %local_invocation_index_1_param_1 BuiltIn LocalInvocationIndex
OpMemberDecorate %S_atomic 0 Offset 0
OpMemberDecorate %S_atomic 1 Offset 4
OpDecorate %_arr_uint_uint_10 ArrayStride 4
OpMemberDecorate %S_atomic 2 Offset 44
%uint = OpTypeInt 32 0
%_ptr_Input_uint = OpTypePointer Input %uint
%local_invocation_index_1_param_1 = OpVariable %_ptr_Input_uint Input
%_ptr_Private_uint = OpTypePointer Private %uint
%6 = OpConstantNull %uint
%local_invocation_index_1 = OpVariable %_ptr_Private_uint Private %6
%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
%void = OpTypeVoid
%13 = OpTypeFunction %void %uint
%uint_0 = OpConstant %uint 0
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%21 = OpConstantNull %int
%uint_2 = OpConstant %uint 2
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%bool = OpTypeBool
%uint_1 = OpConstant %uint 1
%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
%uint_264 = OpConstant %uint 264
%int_4 = OpConstant %int 4
%73 = OpTypeFunction %void
%tint_zero_workgroup_memory = OpFunction %void None %13
%local_idx = OpFunctionParameter %uint
%17 = OpLabel
%idx_1 = OpVariable %_ptr_Function_uint Function %6
%20 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
OpStore %20 %21
%24 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
OpStore %24 %6
OpStore %idx_1 %local_idx
OpBranch %27
%27 = OpLabel
OpLoopMerge %28 %29 None
OpBranch %30
%30 = OpLabel
%32 = OpLoad %uint %idx_1
%33 = OpULessThan %bool %32 %uint_10
%31 = OpLogicalNot %bool %33
OpSelectionMerge %35 None
OpBranchConditional %31 %36 %35
%36 = OpLabel
OpBranch %28
%35 = OpLabel
%37 = OpLoad %uint %idx_1
%42 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %37
OpAtomicStore %42 %uint_2 %uint_0 %6
OpBranch %29
%29 = OpLabel
%43 = OpLoad %uint %idx_1
%44 = OpIAdd %uint %43 %uint_1
OpStore %idx_1 %44
OpBranch %27
%28 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpReturn
OpFunctionEnd
%compute_main_inner = OpFunction %void None %13
%local_invocation_index_2 = OpFunctionParameter %uint
%49 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function %6
OpStore %idx %6
%51 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
OpStore %51 %21
%52 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
OpStore %52 %6
OpStore %idx %local_invocation_index_2
OpBranch %53
%53 = OpLabel
OpLoopMerge %54 %55 None
OpBranch %56
%56 = OpLabel
%58 = OpLoad %uint %idx
%59 = OpULessThan %bool %58 %uint_10
%57 = OpLogicalNot %bool %59
OpSelectionMerge %60 None
OpBranchConditional %57 %61 %60
%61 = OpLabel
OpBranch %54
%60 = OpLabel
%62 = OpLoad %uint %idx
%65 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %62
OpAtomicStore %65 %uint_2 %uint_0 %6
OpBranch %55
%55 = OpLabel
%66 = OpLoad %uint %idx
%67 = OpIAdd %uint %66 %uint_1
OpStore %idx %67
OpBranch %53
%54 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%72 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %int_4
OpAtomicStore %72 %uint_2 %uint_0 %uint_1
OpReturn
OpFunctionEnd
%compute_main_1 = OpFunction %void None %73
%75 = OpLabel
%76 = OpLoad %uint %local_invocation_index_1
%77 = OpFunctionCall %void %compute_main_inner %76
OpReturn
OpFunctionEnd
%compute_main_inner_1 = OpFunction %void None %13
%local_invocation_index_1_param = OpFunctionParameter %uint
%80 = OpLabel
%81 = OpFunctionCall %void %tint_zero_workgroup_memory %local_invocation_index_1_param
OpStore %local_invocation_index_1 %local_invocation_index_1_param
%82 = OpFunctionCall %void %compute_main_1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %73
%84 = OpLabel
%86 = OpLoad %uint %local_invocation_index_1_param_1
%85 = OpFunctionCall %void %compute_main_inner_1 %86
OpReturn
OpFunctionEnd