| ; SPIR-V | |
| ; Version: 1.3 | |
| ; Generator: Google Tint Compiler; 0 | |
| ; Bound: 118 | |
| ; 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 %main_inner "main_inner" | |
| OpName %local_invocation_index "local_invocation_index" | |
| OpName %value "value" | |
| OpName %__atomic_compare_exchange_resultu32 "__atomic_compare_exchange_resultu32" | |
| OpMemberName %__atomic_compare_exchange_resultu32 0 "old_value" | |
| OpMemberName %__atomic_compare_exchange_resultu32 1 "exchanged" | |
| OpName %value_0 "value" | |
| OpName %__atomic_compare_exchange_resulti32 "__atomic_compare_exchange_resulti32" | |
| OpMemberName %__atomic_compare_exchange_resulti32 0 "old_value" | |
| OpMemberName %__atomic_compare_exchange_resulti32 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_resultu32 0 Offset 0 | |
| OpMemberDecorate %__atomic_compare_exchange_resultu32 1 Offset 4 | |
| OpMemberDecorate %__atomic_compare_exchange_resulti32 0 Offset 0 | |
| OpMemberDecorate %__atomic_compare_exchange_resulti32 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_resultu32 = OpTypeStruct %uint %bool | |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint | |
| %int_42 = OpConstant %int 42 | |
| %_ptr_Function_int = OpTypePointer Function %int | |
| %__atomic_compare_exchange_resulti32 = OpTypeStruct %int %bool | |
| %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int | |
| %113 = OpTypeFunction %void | |
| %main_inner = OpFunction %void None %15 | |
| %local_invocation_index = OpFunctionParameter %uint | |
| %19 = 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 | |
| %21 = OpULessThan %bool %local_invocation_index %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 | |
| OpStore %value %uint_42 | |
| %42 = OpAccessChain %_ptr_StorageBuffer_uint %a_u32 %uint_0 | |
| %43 = OpLoad %uint %value | |
| %44 = OpAtomicCompareExchange %uint %42 %uint_1 %uint_0 %uint_0 %43 %29 | |
| %45 = OpIEqual %bool %44 %43 | |
| %38 = OpCompositeConstruct %__atomic_compare_exchange_resultu32 %44 %45 | |
| %48 = OpAccessChain %_ptr_StorageBuffer_uint %a_u32 %uint_0 | |
| %49 = OpLoad %uint %value | |
| %50 = OpAtomicCompareExchange %uint %48 %uint_1 %uint_0 %uint_0 %49 %29 | |
| %51 = OpIEqual %bool %50 %49 | |
| %46 = OpCompositeConstruct %__atomic_compare_exchange_resultu32 %50 %51 | |
| %54 = OpAccessChain %_ptr_StorageBuffer_uint %a_u32 %uint_0 | |
| %55 = OpLoad %uint %value | |
| %56 = OpAtomicCompareExchange %uint %54 %uint_1 %uint_0 %uint_0 %55 %29 | |
| %57 = OpIEqual %bool %56 %55 | |
| %52 = OpCompositeConstruct %__atomic_compare_exchange_resultu32 %56 %57 | |
| OpStore %value_0 %int_42 | |
| %65 = OpAccessChain %_ptr_StorageBuffer_int %a_i32 %uint_0 | |
| %66 = OpLoad %int %value_0 | |
| %67 = OpAtomicCompareExchange %int %65 %uint_1 %uint_0 %uint_0 %66 %32 | |
| %68 = OpIEqual %bool %67 %66 | |
| %61 = OpCompositeConstruct %__atomic_compare_exchange_resulti32 %67 %68 | |
| %71 = OpAccessChain %_ptr_StorageBuffer_int %a_i32 %uint_0 | |
| %72 = OpLoad %int %value_0 | |
| %73 = OpAtomicCompareExchange %int %71 %uint_1 %uint_0 %uint_0 %72 %32 | |
| %74 = OpIEqual %bool %73 %72 | |
| %69 = OpCompositeConstruct %__atomic_compare_exchange_resulti32 %73 %74 | |
| %77 = OpAccessChain %_ptr_StorageBuffer_int %a_i32 %uint_0 | |
| %78 = OpLoad %int %value_0 | |
| %79 = OpAtomicCompareExchange %int %77 %uint_1 %uint_0 %uint_0 %78 %32 | |
| %80 = OpIEqual %bool %79 %78 | |
| %75 = OpCompositeConstruct %__atomic_compare_exchange_resulti32 %79 %80 | |
| OpStore %value_1 %uint_42 | |
| %84 = OpLoad %uint %value_1 | |
| %85 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %84 %29 | |
| %86 = OpIEqual %bool %85 %84 | |
| %82 = OpCompositeConstruct %__atomic_compare_exchange_resultu32 %85 %86 | |
| %89 = OpLoad %uint %value_1 | |
| %90 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %89 %29 | |
| %91 = OpIEqual %bool %90 %89 | |
| %87 = OpCompositeConstruct %__atomic_compare_exchange_resultu32 %90 %91 | |
| %94 = OpLoad %uint %value_1 | |
| %95 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %94 %29 | |
| %96 = OpIEqual %bool %95 %94 | |
| %92 = OpCompositeConstruct %__atomic_compare_exchange_resultu32 %95 %96 | |
| OpStore %value_2 %int_42 | |
| %100 = OpLoad %int %value_2 | |
| %101 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %100 %32 | |
| %102 = OpIEqual %bool %101 %100 | |
| %98 = OpCompositeConstruct %__atomic_compare_exchange_resulti32 %101 %102 | |
| %105 = OpLoad %int %value_2 | |
| %106 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %105 %32 | |
| %107 = OpIEqual %bool %106 %105 | |
| %103 = OpCompositeConstruct %__atomic_compare_exchange_resulti32 %106 %107 | |
| %110 = OpLoad %int %value_2 | |
| %111 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %110 %32 | |
| %112 = OpIEqual %bool %111 %110 | |
| %108 = OpCompositeConstruct %__atomic_compare_exchange_resulti32 %111 %112 | |
| OpReturn | |
| OpFunctionEnd | |
| %main = OpFunction %void None %113 | |
| %115 = OpLabel | |
| %117 = OpLoad %uint %local_invocation_index_1 | |
| %116 = OpFunctionCall %void %main_inner %117 | |
| OpReturn | |
| OpFunctionEnd |