blob: b7a166222fefef9adc9d0a3deb49479ba89a0824 [file]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 55
; Schema: 0
OpCapability Shader
%19 = 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
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%uint_8 = OpConstant %uint 8
%float = OpTypeFloat 32
%float_1 = OpConstant %float 1
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%30 = OpTypeFunction %void %uint
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%bool = OpTypeBool
%uint_0 = OpConstant %uint 0
%foo = OpFunction %void None %10
%11 = OpLabel
%12 = OpISub %uint %uint_4 %uint_1
%15 = OpBitcast %uint %int_0
%18 = OpExtInst %uint %19 UMin %15 %12
%20 = OpIMul %uint %18 %uint_8
%22 = OpUDiv %uint %20 %uint_4
%23 = OpBitcast %uint %float_1
%26 = OpAccessChain %_ptr_Workgroup_uint %v %22
OpStore %26 %23 None
OpReturn
OpFunctionEnd
%main_inner = OpFunction %void None %30
%tint_local_index = OpFunctionParameter %uint
%31 = OpLabel
OpBranch %32
%32 = OpLabel
OpBranch %35
%35 = OpLabel
%37 = OpPhi %uint %tint_local_index %32 %38 %34
OpLoopMerge %36 %34 None
OpBranch %33
%33 = OpLabel
%43 = OpUGreaterThanEqual %bool %37 %uint_16
OpSelectionMerge %45 None
OpBranchConditional %43 %46 %45
%46 = OpLabel
OpBranch %36
%45 = OpLabel
%47 = OpIMul %uint %37 %uint_4
%48 = OpUDiv %uint %47 %uint_4
%49 = OpAccessChain %_ptr_Workgroup_uint %v %48
OpStore %49 %uint_0 None
OpBranch %34
%34 = OpLabel
%38 = OpIAdd %uint %37 %uint_1
OpBranch %35
%36 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%42 = OpFunctionCall %void %foo
OpReturn
OpFunctionEnd
%main = OpFunction %void None %10
%52 = OpLabel
%53 = OpLoad %uint %main_local_invocation_index_Input None
%54 = OpFunctionCall %void %main_inner %53
OpReturn
OpFunctionEnd