blob: 61d232b032bc284ce23b27670d19d6d9556e3d58 [file]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 50
; Schema: 0
OpCapability Shader
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %main_local_invocation_index_Input
OpExecutionMode %main LocalSize 1 1 1
OpName %v "v"
OpName %main_local_invocation_index_Input "main_local_invocation_index_Input"
OpName %foo "foo"
OpName %main_inner "main_inner"
OpName %tint_local_index "tint_local_index"
OpName %main "main"
OpDecorate %main_local_invocation_index_Input BuiltIn LocalInvocationIndex
%uint = OpTypeInt 32 0
%uint_16 = OpConstant %uint 16
%_arr_uint_uint_16 = OpTypeArray %uint %uint_16
%_ptr_Workgroup__arr_uint_uint_16 = OpTypePointer Workgroup %_arr_uint_uint_16
%v = OpVariable %_ptr_Workgroup__arr_uint_uint_16 Workgroup
%_ptr_Input_uint = OpTypePointer Input %uint
%main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
%void = OpTypeVoid
%10 = OpTypeFunction %void
%uint_4 = OpConstant %uint 4
%uint_1 = OpConstant %uint 1
%uint_0 = OpConstant %uint 0
%uint_8 = OpConstant %uint 8
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%uint_1065353216 = OpConstant %uint 1065353216
%26 = OpTypeFunction %void %uint
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%bool = OpTypeBool
%foo = OpFunction %void None %10
%11 = OpLabel
%12 = OpISub %uint %uint_4 %uint_1
%15 = OpExtInst %uint %16 UMin %uint_0 %12
%18 = OpIMul %uint %15 %uint_8
%20 = OpUDiv %uint %18 %uint_4
%21 = OpAccessChain %_ptr_Workgroup_uint %v %20
OpStore %21 %uint_1065353216 None
OpReturn
OpFunctionEnd
%main_inner = OpFunction %void None %26
%tint_local_index = OpFunctionParameter %uint
%27 = OpLabel
OpBranch %28
%28 = OpLabel
OpBranch %31
%31 = OpLabel
%33 = OpPhi %uint %tint_local_index %28 %34 %30
OpLoopMerge %32 %30 None
OpBranch %29
%29 = OpLabel
%39 = OpUGreaterThanEqual %bool %33 %uint_16
OpSelectionMerge %41 None
OpBranchConditional %39 %42 %41
%42 = OpLabel
OpBranch %32
%41 = OpLabel
%43 = OpIMul %uint %33 %uint_4
%44 = OpUDiv %uint %43 %uint_4
%45 = OpAccessChain %_ptr_Workgroup_uint %v %44
OpStore %45 %uint_0 None
OpBranch %30
%30 = OpLabel
%34 = OpIAdd %uint %33 %uint_1
OpBranch %31
%32 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%38 = OpFunctionCall %void %foo
OpReturn
OpFunctionEnd
%main = OpFunction %void None %10
%47 = OpLabel
%48 = OpLoad %uint %main_local_invocation_index_Input None
%49 = OpFunctionCall %void %main_inner %48
OpReturn
OpFunctionEnd