blob: bdf2327353730b1e7ec3ed9bf79c3b7bae2d7b32 [file]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 131
; Schema: 0
OpCapability Shader
%68 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpMemberName %S_tint_explicit_layout 0 "a"
OpName %S_tint_explicit_layout "S_tint_explicit_layout"
OpMemberName %buffer_block_tint_explicit_layout 0 "inner"
OpName %buffer_block_tint_explicit_layout "buffer_block_tint_explicit_layout"
OpName %v "v"
OpName %idx1 "idx1"
OpName %idx2 "idx2"
OpName %idx3 "idx3"
OpName %idx4 "idx4"
OpName %idx5 "idx5"
OpName %idx6 "idx6"
OpName %main "main"
OpName %tint_loop_idx "tint_loop_idx"
OpName %tint_low_inc "tint_low_inc"
OpName %tint_carry "tint_carry"
OpDecorate %_arr_v4int_uint_4 ArrayStride 16
OpMemberDecorate %S_tint_explicit_layout 0 Offset 0
OpDecorate %_runtimearr_S_tint_explicit_layout ArrayStride 64
OpMemberDecorate %buffer_block_tint_explicit_layout 0 Offset 0
OpDecorate %buffer_block_tint_explicit_layout Block
OpDecorate %1 DescriptorSet 0
OpDecorate %1 Binding 0
OpDecorate %1 Coherent
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_v4int_uint_4 = OpTypeArray %v4int %uint_4
%S_tint_explicit_layout = OpTypeStruct %_arr_v4int_uint_4
%_runtimearr_S_tint_explicit_layout = OpTypeRuntimeArray %S_tint_explicit_layout
%buffer_block_tint_explicit_layout = OpTypeStruct %_runtimearr_S_tint_explicit_layout
%_ptr_StorageBuffer_buffer_block_tint_explicit_layout = OpTypePointer StorageBuffer %buffer_block_tint_explicit_layout
%1 = OpVariable %_ptr_StorageBuffer_buffer_block_tint_explicit_layout StorageBuffer
%_ptr_Private_uint = OpTypePointer Private %uint
%13 = OpConstantNull %uint
%v = OpVariable %_ptr_Private_uint Private %13
%15 = OpTypeFunction %int
%uint_1 = OpConstant %uint 1
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%int_0 = OpConstant %int 0
%void = OpTypeVoid
%47 = OpTypeFunction %void
%v2uint = OpTypeVector %uint 2
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
%uint_4294967295 = OpConstant %uint 4294967295
%57 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
%_ptr_StorageBuffer__runtimearr_S_tint_explicit_layout = OpTypePointer StorageBuffer %_runtimearr_S_tint_explicit_layout
%uint_0 = OpConstant %uint 0
%uint_3 = OpConstant %uint 3
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%88 = OpConstantNull %v2uint
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
%uint_10 = OpConstant %uint 10
%_ptr_Function_uint = OpTypePointer Function %uint
%idx1 = OpFunction %int None %15
%16 = OpLabel
%17 = OpLoad %uint %v None
%18 = OpIAdd %uint %17 %uint_1
OpStore %v %18 None
OpReturnValue %int_1
OpFunctionEnd
%idx2 = OpFunction %int None %15
%22 = OpLabel
%23 = OpLoad %uint %v None
%24 = OpIAdd %uint %23 %uint_1
OpStore %v %24 None
OpReturnValue %int_2
OpFunctionEnd
%idx3 = OpFunction %int None %15
%27 = OpLabel
%28 = OpLoad %uint %v None
%29 = OpIAdd %uint %28 %uint_1
OpStore %v %29 None
OpReturnValue %int_3
OpFunctionEnd
%idx4 = OpFunction %int None %15
%32 = OpLabel
%33 = OpLoad %uint %v None
%34 = OpIAdd %uint %33 %uint_1
OpStore %v %34 None
OpReturnValue %int_4
OpFunctionEnd
%idx5 = OpFunction %int None %15
%37 = OpLabel
%38 = OpLoad %uint %v None
%39 = OpIAdd %uint %38 %uint_1
OpStore %v %39 None
OpReturnValue %int_0
OpFunctionEnd
%idx6 = OpFunction %int None %15
%42 = OpLabel
%43 = OpLoad %uint %v None
%44 = OpIAdd %uint %43 %uint_1
OpStore %v %44 None
OpReturnValue %int_2
OpFunctionEnd
%main = OpFunction %void None %47
%48 = OpLabel
%tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
OpBranch %49
%49 = OpLabel
OpStore %tint_loop_idx %57
%59 = OpFunctionCall %int %idx1
%60 = OpFunctionCall %int %idx2
%61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_S_tint_explicit_layout %1 %uint_0
%64 = OpArrayLength %uint %1 0
%65 = OpISub %uint %64 %uint_1
%66 = OpBitcast %uint %59
%67 = OpExtInst %uint %68 UMin %66 %65
%69 = OpBitcast %uint %60
%70 = OpExtInst %uint %68 UMin %69 %uint_3
%72 = OpAccessChain %_ptr_StorageBuffer_v4int %1 %uint_0 %67 %uint_0 %70
%74 = OpFunctionCall %int %idx3
%75 = OpBitcast %uint %74
%76 = OpExtInst %uint %68 UMin %75 %uint_3
%77 = OpAccessChain %_ptr_StorageBuffer_int %72 %76
%79 = OpLoad %int %77 None
%80 = OpBitcast %uint %79
%81 = OpIAdd %uint %80 %uint_1
%82 = OpBitcast %int %81
%83 = OpBitcast %uint %74
%84 = OpExtInst %uint %68 UMin %83 %uint_3
%85 = OpAccessChain %_ptr_StorageBuffer_int %72 %84
OpStore %85 %82 None
OpBranch %52
%52 = OpLabel
OpLoopMerge %53 %51 None
OpBranch %50
%50 = OpLabel
%86 = OpLoad %v2uint %tint_loop_idx None
%87 = OpIEqual %v2bool %86 %88
%91 = OpAll %bool %87
OpSelectionMerge %92 None
OpBranchConditional %91 %93 %92
%93 = OpLabel
OpBranch %53
%92 = OpLabel
%94 = OpLoad %uint %v None
%95 = OpULessThan %bool %94 %uint_10
OpSelectionMerge %97 None
OpBranchConditional %95 %97 %98
%98 = OpLabel
OpBranch %53
%97 = OpLabel
OpBranch %51
%51 = OpLabel
%99 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
%101 = OpLoad %uint %99 None
%tint_low_inc = OpISub %uint %101 %uint_1
%103 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
OpStore %103 %tint_low_inc None
%104 = OpIEqual %bool %tint_low_inc %uint_4294967295
%tint_carry = OpSelect %uint %104 %uint_1 %uint_0
%106 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
%107 = OpLoad %uint %106 None
%108 = OpISub %uint %107 %tint_carry
%109 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
OpStore %109 %108 None
%110 = OpFunctionCall %int %idx4
%111 = OpFunctionCall %int %idx5
%112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_S_tint_explicit_layout %1 %uint_0
%113 = OpArrayLength %uint %1 0
%114 = OpISub %uint %113 %uint_1
%115 = OpBitcast %uint %110
%116 = OpExtInst %uint %68 UMin %115 %114
%117 = OpBitcast %uint %111
%118 = OpExtInst %uint %68 UMin %117 %uint_3
%119 = OpAccessChain %_ptr_StorageBuffer_v4int %1 %uint_0 %116 %uint_0 %118
%120 = OpFunctionCall %int %idx6
%121 = OpBitcast %uint %120
%122 = OpExtInst %uint %68 UMin %121 %uint_3
%123 = OpAccessChain %_ptr_StorageBuffer_int %119 %122
%124 = OpLoad %int %123 None
%125 = OpBitcast %uint %124
%126 = OpIAdd %uint %125 %uint_1
%127 = OpBitcast %int %126
%128 = OpBitcast %uint %120
%129 = OpExtInst %uint %68 UMin %128 %uint_3
%130 = OpAccessChain %_ptr_StorageBuffer_int %119 %129
OpStore %130 %127 None
OpBranch %52
%53 = OpLabel
OpReturn
OpFunctionEnd