blob: 6db60b73512537dc33a5ed38f789a1c884ac8d59 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 51
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %value
OpExecutionMode %main OriginUpperLeft
OpName %tint_discarded "tint_discarded"
OpName %value "value"
OpName %S_block "S_block"
OpMemberName %S_block 0 "inner"
OpName %S "S"
OpName %main_inner "main_inner"
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 %tint_symbol_1 "tint_symbol_1"
OpName %main "main"
OpDecorate %value Location 0
OpDecorate %S_block Block
OpMemberDecorate %S_block 0 Offset 0
OpDecorate %S DescriptorSet 0
OpDecorate %S Binding 0
OpMemberDecorate %__atomic_compare_exchange_result_i32 0 Offset 0
OpMemberDecorate %__atomic_compare_exchange_result_i32 1 Offset 4
%bool = OpTypeBool
%2 = OpConstantNull %bool
%_ptr_Private_bool = OpTypePointer Private %bool
%tint_discarded = OpVariable %_ptr_Private_bool Private %2
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%9 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %9
%int = OpTypeInt 32 1
%S_block = OpTypeStruct %int
%_ptr_StorageBuffer_S_block = OpTypePointer StorageBuffer %S_block
%S = OpVariable %_ptr_StorageBuffer_S_block StorageBuffer
%14 = OpTypeFunction %v4float
%true = OpConstantTrue %bool
%__atomic_compare_exchange_result_i32 = OpTypeStruct %int %bool
%_ptr_Function___atomic_compare_exchange_result_i32 = OpTypePointer Function %__atomic_compare_exchange_result_i32
%23 = OpConstantNull %__atomic_compare_exchange_result_i32
%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
%36 = OpConstantNull %int
%void = OpTypeVoid
%43 = OpTypeFunction %void
%main_inner = OpFunction %v4float None %14
%16 = OpLabel
%tint_symbol_1 = OpVariable %_ptr_Function___atomic_compare_exchange_result_i32 Function %23
OpSelectionMerge %17 None
OpBranchConditional %2 %18 %17
%18 = OpLabel
OpStore %tint_discarded %true
OpBranch %17
%17 = OpLabel
%25 = OpLoad %bool %tint_discarded
%24 = OpLogicalNot %bool %25
OpSelectionMerge %26 None
OpBranchConditional %24 %27 %26
%27 = OpLabel
%34 = OpAccessChain %_ptr_StorageBuffer_int %S %uint_0
%37 = OpAtomicCompareExchange %int %34 %uint_1 %uint_0 %uint_0 %int_1 %36
%38 = OpIEqual %bool %37 %36
%28 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %37 %38
OpStore %tint_symbol_1 %28
OpBranch %26
%26 = OpLabel
%39 = OpLoad %__atomic_compare_exchange_result_i32 %tint_symbol_1
%40 = OpCompositeExtract %int %39 0
%41 = OpConvertSToF %float %40
%42 = OpCompositeConstruct %v4float %41 %41 %41 %41
OpReturnValue %42
OpFunctionEnd
%main = OpFunction %void None %43
%46 = OpLabel
%47 = OpFunctionCall %v4float %main_inner
OpStore %value %47
%48 = OpLoad %bool %tint_discarded
OpSelectionMerge %49 None
OpBranchConditional %48 %50 %49
%50 = OpLabel
OpKill
%49 = OpLabel
OpReturn
OpFunctionEnd