| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 22 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %compute_main "compute_main" |
| OpExecutionMode %compute_main LocalSize 1 1 1 |
| OpName %a_block "a_block" |
| OpMemberName %a_block 0 "inner" |
| OpName %a "a" |
| OpName %compute_main "compute_main" |
| 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" |
| OpDecorate %a_block Block |
| OpMemberDecorate %a_block 0 Offset 0 |
| OpDecorate %a DescriptorSet 0 |
| OpDecorate %a Binding 0 |
| OpMemberDecorate %__atomic_compare_exchange_result_i32 0 Offset 0 |
| OpMemberDecorate %__atomic_compare_exchange_result_i32 1 Offset 4 |
| %int = OpTypeInt 32 1 |
| %a_block = OpTypeStruct %int |
| %_ptr_StorageBuffer_a_block = OpTypePointer StorageBuffer %a_block |
| %a = OpVariable %_ptr_StorageBuffer_a_block StorageBuffer |
| %void = OpTypeVoid |
| %5 = OpTypeFunction %void |
| %bool = OpTypeBool |
| %__atomic_compare_exchange_result_i32 = OpTypeStruct %int %bool |
| %uint = OpTypeInt 32 0 |
| %uint_1 = OpConstant %uint 1 |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| %int_1 = OpConstant %int 1 |
| %compute_main = OpFunction %void None %5 |
| %8 = OpLabel |
| %17 = OpAccessChain %_ptr_StorageBuffer_int %a %uint_0 |
| %19 = OpAtomicCompareExchange %int %17 %uint_1 %uint_0 %uint_0 %int_1 %int_1 |
| %20 = OpIEqual %bool %19 %int_1 |
| %9 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %19 %20 |
| %21 = OpCompositeExtract %int %9 0 |
| OpReturn |
| OpFunctionEnd |