| ; SPIR-V | |
| ; Version: 1.3 | |
| ; Generator: Google Tint Compiler; 0 | |
| ; Bound: 24 | |
| ; Schema: 0 | |
| OpCapability Shader | |
| OpMemoryModel Logical GLSL450 | |
| OpEntryPoint GLCompute %main "main" | |
| OpExecutionMode %main LocalSize 16 1 1 | |
| OpName %a_block "a_block" | |
| OpMemberName %a_block 0 "inner" | |
| OpName %a "a" | |
| OpName %main "main" | |
| 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" | |
| OpDecorate %a_block Block | |
| OpMemberDecorate %a_block 0 Offset 0 | |
| OpDecorate %a DescriptorSet 0 | |
| OpDecorate %a Binding 0 | |
| OpMemberDecorate %__atomic_compare_exchange_resultu32 0 Offset 0 | |
| OpMemberDecorate %__atomic_compare_exchange_resultu32 1 Offset 4 | |
| %uint = OpTypeInt 32 0 | |
| %a_block = OpTypeStruct %uint | |
| %_ptr_StorageBuffer_a_block = OpTypePointer StorageBuffer %a_block | |
| %a = OpVariable %_ptr_StorageBuffer_a_block StorageBuffer | |
| %void = OpTypeVoid | |
| %5 = OpTypeFunction %void | |
| %uint_42 = OpConstant %uint 42 | |
| %_ptr_Function_uint = OpTypePointer Function %uint | |
| %12 = OpConstantNull %uint | |
| %bool = OpTypeBool | |
| %__atomic_compare_exchange_resultu32 = OpTypeStruct %uint %bool | |
| %uint_1 = OpConstant %uint 1 | |
| %uint_0 = OpConstant %uint 0 | |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint | |
| %main = OpFunction %void None %5 | |
| %8 = OpLabel | |
| %value = OpVariable %_ptr_Function_uint Function %12 | |
| OpStore %value %uint_42 | |
| %20 = OpAccessChain %_ptr_StorageBuffer_uint %a %uint_0 | |
| %21 = OpLoad %uint %value | |
| %22 = OpAtomicCompareExchange %uint %20 %uint_1 %uint_0 %uint_0 %21 %12 | |
| %23 = OpIEqual %bool %22 %21 | |
| %13 = OpCompositeConstruct %__atomic_compare_exchange_resultu32 %22 %23 | |
| OpReturn | |
| OpFunctionEnd |