blob: d24fbd6221983c91bacafd6089ef9c2d342461a6 [file]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 117
; Schema: 0
OpCapability Shader
%68 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %main_local_invocation_index_Input
OpExecutionMode %main LocalSize 1 1 1
OpMemberName %in_block_tint_explicit_layout 0 "inner"
OpName %in_block_tint_explicit_layout "in_block_tint_explicit_layout"
OpMemberName %out_block_tint_explicit_layout 0 "inner"
OpName %out_block_tint_explicit_layout "out_block_tint_explicit_layout"
OpName %b "b"
OpName %main_local_invocation_index_Input "main_local_invocation_index_Input"
OpName %main_inner "main_inner"
OpName %tint_local_index "tint_local_index"
OpName %idx "idx"
OpName %i "i"
OpName %i_0 "i"
OpName %main "main"
OpDecorate %_runtimearr_uint ArrayStride 4
OpMemberDecorate %in_block_tint_explicit_layout 0 Offset 0
OpDecorate %in_block_tint_explicit_layout Block
OpDecorate %1 DescriptorSet 0
OpDecorate %1 Binding 0
OpDecorate %1 NonWritable
OpMemberDecorate %out_block_tint_explicit_layout 0 Offset 0
OpDecorate %out_block_tint_explicit_layout Block
OpDecorate %6 DescriptorSet 0
OpDecorate %6 Binding 1
OpDecorate %6 Coherent
OpDecorate %main_local_invocation_index_Input BuiltIn LocalInvocationIndex
%uint = OpTypeInt 32 0
%_runtimearr_uint = OpTypeRuntimeArray %uint
%in_block_tint_explicit_layout = OpTypeStruct %_runtimearr_uint
%_ptr_StorageBuffer_in_block_tint_explicit_layout = OpTypePointer StorageBuffer %in_block_tint_explicit_layout
%1 = OpVariable %_ptr_StorageBuffer_in_block_tint_explicit_layout StorageBuffer
%out_block_tint_explicit_layout = OpTypeStruct %_runtimearr_uint
%_ptr_StorageBuffer_out_block_tint_explicit_layout = OpTypePointer StorageBuffer %out_block_tint_explicit_layout
%6 = OpVariable %_ptr_StorageBuffer_out_block_tint_explicit_layout StorageBuffer
%uint_64 = OpConstant %uint 64
%_arr_uint_uint_64 = OpTypeArray %uint %uint_64
%_ptr_Workgroup__arr_uint_uint_64 = OpTypePointer Workgroup %_arr_uint_uint_64
%b = OpVariable %_ptr_Workgroup__arr_uint_uint_64 Workgroup
%_ptr_Input_uint = OpTypePointer Input %uint
%main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
%void = OpTypeVoid
%18 = OpTypeFunction %void %uint
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%_ptr_Function_uint = OpTypePointer Function %uint
%bool = OpTypeBool
%uint_4 = OpConstant %uint 4
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%int_0 = OpConstant %int 0
%int_64 = OpConstant %int 64
%_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint
%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
%113 = OpTypeFunction %void
%main_inner = OpFunction %void None %18
%tint_local_index = OpFunctionParameter %uint
%19 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function
%i = OpVariable %_ptr_Function_int Function
%i_0 = OpVariable %_ptr_Function_int Function
OpBranch %20
%20 = OpLabel
OpStore %idx %tint_local_index
OpBranch %23
%23 = OpLabel
OpLoopMerge %24 %22 None
OpBranch %21
%21 = OpLabel
%41 = OpLoad %uint %idx None
%42 = OpUGreaterThanEqual %bool %41 %uint_64
OpSelectionMerge %44 None
OpBranchConditional %42 %45 %44
%45 = OpLabel
OpBranch %24
%44 = OpLabel
%46 = OpIMul %uint %41 %uint_4
%48 = OpUDiv %uint %46 %uint_4
%49 = OpAccessChain %_ptr_Workgroup_uint %b %48
OpStore %49 %uint_0 None
OpBranch %22
%22 = OpLabel
%52 = OpLoad %uint %idx None
%53 = OpIAdd %uint %52 %uint_1
OpStore %idx %53 None
OpBranch %23
%24 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpBranch %28
%28 = OpLabel
OpStore %i %int_0
OpBranch %31
%31 = OpLabel
OpLoopMerge %32 %30 None
OpBranch %29
%29 = OpLabel
%59 = OpLoad %int %i None
%60 = OpSLessThan %bool %59 %int_64
OpSelectionMerge %62 None
OpBranchConditional %60 %62 %63
%63 = OpLabel
OpBranch %32
%62 = OpLabel
%64 = OpLoad %int %i None
%65 = OpISub %uint %uint_64 %uint_1
%66 = OpBitcast %uint %64
%67 = OpExtInst %uint %68 UMin %66 %65
%69 = OpIMul %uint %67 %uint_4
%70 = OpLoad %int %i None
%71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0
%73 = OpArrayLength %uint %1 0
%74 = OpISub %uint %73 %uint_1
%75 = OpBitcast %uint %70
%76 = OpExtInst %uint %68 UMin %75 %74
%77 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %76
%79 = OpLoad %uint %77 None
%80 = OpUDiv %uint %69 %uint_4
%81 = OpAccessChain %_ptr_Workgroup_uint %b %80
OpStore %81 %79 None
OpBranch %30
%30 = OpLabel
%82 = OpLoad %int %i None
%83 = OpBitcast %uint %82
%84 = OpIAdd %uint %83 %uint_1
%85 = OpBitcast %int %84
OpStore %i %85 None
OpBranch %31
%32 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpBranch %34
%34 = OpLabel
OpStore %i_0 %int_0
OpBranch %37
%37 = OpLabel
OpLoopMerge %38 %36 None
OpBranch %35
%35 = OpLabel
%87 = OpLoad %int %i_0 None
%88 = OpSLessThan %bool %87 %int_64
OpSelectionMerge %89 None
OpBranchConditional %88 %89 %90
%90 = OpLabel
OpBranch %38
%89 = OpLabel
%91 = OpLoad %int %i_0 None
%92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %6 %uint_0
%94 = OpArrayLength %uint %6 0
%95 = OpISub %uint %94 %uint_1
%96 = OpBitcast %uint %91
%97 = OpExtInst %uint %68 UMin %96 %95
%98 = OpAccessChain %_ptr_StorageBuffer_uint_0 %6 %uint_0 %97
%100 = OpLoad %int %i_0 None
%101 = OpISub %uint %uint_64 %uint_1
%102 = OpBitcast %uint %100
%103 = OpExtInst %uint %68 UMin %102 %101
%104 = OpIMul %uint %103 %uint_4
%105 = OpUDiv %uint %104 %uint_4
%106 = OpAccessChain %_ptr_Workgroup_uint %b %105
%107 = OpLoad %uint %106 None
OpStore %98 %107 None
OpBranch %36
%36 = OpLabel
%108 = OpLoad %int %i_0 None
%109 = OpBitcast %uint %108
%110 = OpIAdd %uint %109 %uint_1
%111 = OpBitcast %int %110
OpStore %i_0 %111 None
OpBranch %37
%38 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %113
%114 = OpLabel
%115 = OpLoad %uint %main_local_invocation_index_Input None
%116 = OpFunctionCall %void %main_inner %115
OpReturn
OpFunctionEnd