blob: 49ed15a6b12d33dbbcdb680e0a5f33cd46dd029e [file]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 53
; 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
OpMemberName %S 0 "x"
OpMemberName %S 1 "a"
OpMemberName %S 2 "y"
OpName %S "S"
OpName %wg "wg"
OpName %compute_main_local_invocation_index_Input "compute_main_local_invocation_index_Input"
OpName %compute_main_inner "compute_main_inner"
OpName %tint_local_index "tint_local_index"
OpName %idx "idx"
OpName %compute_main "compute_main"
OpDecorate %compute_main_local_invocation_index_Input BuiltIn LocalInvocationIndex
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_10 = OpConstant %uint 10
%_arr_uint_uint_10 = OpTypeArray %uint %uint_10
%S = OpTypeStruct %int %_arr_uint_uint_10 %uint
%_ptr_Workgroup_S = OpTypePointer Workgroup %S
%wg = OpVariable %_ptr_Workgroup_S Workgroup
%_ptr_Input_uint = OpTypePointer Input %uint
%compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
%void = OpTypeVoid
%13 = OpTypeFunction %void %uint
%uint_1 = OpConstant %uint 1
%bool = OpTypeBool
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%uint_4 = OpConstant %uint 4
%uint_0 = OpConstant %uint 0
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%int_0 = OpConstant %int 0
%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%49 = OpTypeFunction %void
%compute_main_inner = OpFunction %void None %13
%tint_local_index = OpFunctionParameter %uint
%14 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function
%15 = OpULessThan %bool %tint_local_index %uint_1
OpSelectionMerge %18 None
OpBranchConditional %15 %19 %18
%19 = OpLabel
%33 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
OpStore %33 %int_0 None
%36 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_2
OpStore %36 %uint_0 None
OpBranch %18
%18 = OpLabel
OpBranch %20
%20 = OpLabel
OpStore %idx %tint_local_index
OpBranch %23
%23 = OpLabel
OpLoopMerge %24 %22 None
OpBranch %21
%21 = OpLabel
%40 = OpLoad %uint %idx None
%41 = OpUGreaterThanEqual %bool %40 %uint_10
OpSelectionMerge %42 None
OpBranchConditional %41 %43 %42
%43 = OpLabel
OpBranch %24
%42 = OpLabel
%44 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1 %40
OpAtomicStore %44 %uint_2 %uint_0 %uint_0
OpBranch %22
%22 = OpLabel
%46 = OpLoad %uint %idx None
%47 = OpIAdd %uint %46 %uint_1
OpStore %idx %47 None
OpBranch %23
%24 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%28 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1 %uint_4
OpAtomicStore %28 %uint_2 %uint_0 %uint_1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %49
%50 = OpLabel
%51 = OpLoad %uint %compute_main_local_invocation_index_Input None
%52 = OpFunctionCall %void %compute_main_inner %51
OpReturn
OpFunctionEnd