blob: 1af77be6b3f984e3a6c05f5c7c0b5acbf8ea1c68 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 122
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %local_invocation_index_1
OpExecutionMode %main LocalSize 16 1 1
OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %a_u32_block "a_u32_block"
OpMemberName %a_u32_block 0 "inner"
OpName %a_u32 "a_u32"
OpName %a_i32_block "a_i32_block"
OpMemberName %a_i32_block 0 "inner"
OpName %a_i32 "a_i32"
OpName %b_u32 "b_u32"
OpName %b_i32 "b_i32"
OpName %tint_zero_workgroup_memory "tint_zero_workgroup_memory"
OpName %local_idx "local_idx"
OpName %main_inner "main_inner"
OpName %local_invocation_index "local_invocation_index"
OpName %value "value"
OpName %__atomic_compare_exchange_result_u32 "__atomic_compare_exchange_result_u32"
OpMemberName %__atomic_compare_exchange_result_u32 0 "old_value"
OpMemberName %__atomic_compare_exchange_result_u32 1 "exchanged"
OpName %value_0 "value"
OpName %__atomic_compare_exchange_result_i32 "__atomic_compare_exchange_result_i32"
OpMemberName %__atomic_compare_exchange_result_i32 0 "old_value"
OpMemberName %__atomic_compare_exchange_result_i32 1 "exchanged"
OpName %value_1 "value"
OpName %value_2 "value"
OpName %main "main"
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
OpDecorate %a_u32_block Block
OpMemberDecorate %a_u32_block 0 Offset 0
OpDecorate %a_u32 DescriptorSet 0
OpDecorate %a_u32 Binding 0
OpDecorate %a_i32_block Block
OpMemberDecorate %a_i32_block 0 Offset 0
OpDecorate %a_i32 DescriptorSet 0
OpDecorate %a_i32 Binding 1
OpMemberDecorate %__atomic_compare_exchange_result_u32 0 Offset 0
OpMemberDecorate %__atomic_compare_exchange_result_u32 1 Offset 4
OpMemberDecorate %__atomic_compare_exchange_result_i32 0 Offset 0
OpMemberDecorate %__atomic_compare_exchange_result_i32 1 Offset 4
%uint = OpTypeInt 32 0
%_ptr_Input_uint = OpTypePointer Input %uint
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%a_u32_block = OpTypeStruct %uint
%_ptr_StorageBuffer_a_u32_block = OpTypePointer StorageBuffer %a_u32_block
%a_u32 = OpVariable %_ptr_StorageBuffer_a_u32_block StorageBuffer
%int = OpTypeInt 32 1
%a_i32_block = OpTypeStruct %int
%_ptr_StorageBuffer_a_i32_block = OpTypePointer StorageBuffer %a_i32_block
%a_i32 = OpVariable %_ptr_StorageBuffer_a_i32_block StorageBuffer
%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
%b_u32 = OpVariable %_ptr_Workgroup_uint Workgroup
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%b_i32 = OpVariable %_ptr_Workgroup_int Workgroup
%void = OpTypeVoid
%15 = OpTypeFunction %void %uint
%uint_1 = OpConstant %uint 1
%bool = OpTypeBool
%uint_2 = OpConstant %uint 2
%uint_0 = OpConstant %uint 0
%29 = OpConstantNull %uint
%32 = OpConstantNull %int
%uint_264 = OpConstant %uint 264
%uint_42 = OpConstant %uint 42
%_ptr_Function_uint = OpTypePointer Function %uint
%__atomic_compare_exchange_result_u32 = OpTypeStruct %uint %bool
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%int_42 = OpConstant %int 42
%_ptr_Function_int = OpTypePointer Function %int
%__atomic_compare_exchange_result_i32 = OpTypeStruct %int %bool
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%117 = OpTypeFunction %void
%tint_zero_workgroup_memory = OpFunction %void None %15
%local_idx = OpFunctionParameter %uint
%19 = OpLabel
%21 = OpULessThan %bool %local_idx %uint_1
OpSelectionMerge %23 None
OpBranchConditional %21 %24 %23
%24 = OpLabel
OpAtomicStore %b_u32 %uint_2 %uint_0 %29
OpAtomicStore %b_i32 %uint_2 %uint_0 %32
OpBranch %23
%23 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpReturn
OpFunctionEnd
%main_inner = OpFunction %void None %15
%local_invocation_index = OpFunctionParameter %uint
%37 = OpLabel
%value = OpVariable %_ptr_Function_uint Function %29
%value_0 = OpVariable %_ptr_Function_int Function %32
%value_1 = OpVariable %_ptr_Function_uint Function %29
%value_2 = OpVariable %_ptr_Function_int Function %32
%38 = OpFunctionCall %void %tint_zero_workgroup_memory %local_invocation_index
OpStore %value %uint_42
%46 = OpAccessChain %_ptr_StorageBuffer_uint %a_u32 %uint_0
%47 = OpLoad %uint %value
%48 = OpAtomicCompareExchange %uint %46 %uint_1 %uint_0 %uint_0 %47 %29
%49 = OpIEqual %bool %48 %29
%42 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %48 %49
%52 = OpAccessChain %_ptr_StorageBuffer_uint %a_u32 %uint_0
%53 = OpLoad %uint %value
%54 = OpAtomicCompareExchange %uint %52 %uint_1 %uint_0 %uint_0 %53 %29
%55 = OpIEqual %bool %54 %29
%50 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %54 %55
%58 = OpAccessChain %_ptr_StorageBuffer_uint %a_u32 %uint_0
%59 = OpLoad %uint %value
%60 = OpAtomicCompareExchange %uint %58 %uint_1 %uint_0 %uint_0 %59 %29
%61 = OpIEqual %bool %60 %29
%56 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %60 %61
OpStore %value_0 %int_42
%69 = OpAccessChain %_ptr_StorageBuffer_int %a_i32 %uint_0
%70 = OpLoad %int %value_0
%71 = OpAtomicCompareExchange %int %69 %uint_1 %uint_0 %uint_0 %70 %32
%72 = OpIEqual %bool %71 %32
%65 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %71 %72
%75 = OpAccessChain %_ptr_StorageBuffer_int %a_i32 %uint_0
%76 = OpLoad %int %value_0
%77 = OpAtomicCompareExchange %int %75 %uint_1 %uint_0 %uint_0 %76 %32
%78 = OpIEqual %bool %77 %32
%73 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %77 %78
%81 = OpAccessChain %_ptr_StorageBuffer_int %a_i32 %uint_0
%82 = OpLoad %int %value_0
%83 = OpAtomicCompareExchange %int %81 %uint_1 %uint_0 %uint_0 %82 %32
%84 = OpIEqual %bool %83 %32
%79 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %83 %84
OpStore %value_1 %uint_42
%88 = OpLoad %uint %value_1
%89 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %88 %29
%90 = OpIEqual %bool %89 %29
%86 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %89 %90
%93 = OpLoad %uint %value_1
%94 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %93 %29
%95 = OpIEqual %bool %94 %29
%91 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %94 %95
%98 = OpLoad %uint %value_1
%99 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %98 %29
%100 = OpIEqual %bool %99 %29
%96 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %99 %100
OpStore %value_2 %int_42
%104 = OpLoad %int %value_2
%105 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %104 %32
%106 = OpIEqual %bool %105 %32
%102 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %105 %106
%109 = OpLoad %int %value_2
%110 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %109 %32
%111 = OpIEqual %bool %110 %32
%107 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %110 %111
%114 = OpLoad %int %value_2
%115 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %114 %32
%116 = OpIEqual %bool %115 %32
%112 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %115 %116
OpReturn
OpFunctionEnd
%main = OpFunction %void None %117
%119 = OpLabel
%121 = OpLoad %uint %local_invocation_index_1
%120 = OpFunctionCall %void %main_inner %121
OpReturn
OpFunctionEnd