@@ -8464,24 +8464,27 @@ for (const auto& item : atomics)
8464
8464
}}}}
8465
8465
8466
8466
8467
+ __glsl_version(430 )
8468
+ [ForceInline]
8469
+ [require(glsl_spirv, atomic_glsl)]
8470
+ __intrinsic_op($(kIROp_AtomicAdd ))
8471
+ $(item .name ) atomicAddWithOrder(inout $(item .name ) mem, $(item .name ) data, MemoryOrder order);
8472
+
8467
8473
__glsl_version(430 )
8468
8474
[ForceInline]
8469
8475
[require(glsl_spirv, atomic_glsl)]
8470
8476
public $(item .name ) atomicAdd(inout $(item .name ) mem, $(item .name ) data)
8471
8477
{
8472
8478
typeRequireChecks_atomic_using_float1_tier< $(item .name )> ();
8473
8479
typeRequireChecks_atomic_using_add< $(item .name )> ();
8474
- __target_switch
8475
- {
8476
- case glsl: __intrinsic_asm " atomicAdd($0, $1)" ;
8477
- case spirv:
8478
- return spirv_asm
8479
- {
8480
- OpAtomic$(item .classType )Add$(item .suffix ) $$$(item .name ) result & mem Device UniformMemory $data
8481
- };
8482
- }
8480
+ return atomicAddWithOrder(mem, data, MemoryOrder::Relaxed);
8483
8481
}
8484
8482
8483
+ __glsl_version(430 )
8484
+ [ForceInline]
8485
+ [require(glsl_spirv, atomic_glsl)]
8486
+ __intrinsic_op($(kIROp_AtomicMin ))
8487
+ $(item .name ) atomicMinWithOrder(inout $(item .name ) mem, $(item .name ) data, MemoryOrder order);
8485
8488
8486
8489
__glsl_version(430 )
8487
8490
[ForceInline]
@@ -8490,17 +8493,14 @@ public $(item.name) atomicMin(inout $(item.name) mem, $(item.name) data)
8490
8493
{
8491
8494
typeRequireChecks_atomic_using_float2_tier< $(item .name )> ();
8492
8495
typeRequireChecks_atomic_using_MinMax< $(item .name )> ();
8493
- __target_switch
8494
- {
8495
- case glsl: __intrinsic_asm " atomicMin($0, $1)" ;
8496
- case spirv:
8497
- return spirv_asm
8498
- {
8499
- OpAtomic$(item .subclassType )Min$(item .suffix ) $$$(item .name ) result & mem Device UniformMemory $data
8500
- };
8501
- }
8496
+ return atomicMinWithOrder(mem, data, MemoryOrder::Relaxed);
8502
8497
}
8503
8498
8499
+ __glsl_version(430 )
8500
+ [ForceInline]
8501
+ [require(glsl_spirv, atomic_glsl)]
8502
+ __intrinsic_op($(kIROp_AtomicMax ))
8503
+ $(item .name ) atomicMaxWithOrder(inout $(item .name ) mem, $(item .name ) data, MemoryOrder order);
8504
8504
8505
8505
__glsl_version(430 )
8506
8506
[ForceInline]
@@ -8509,33 +8509,22 @@ public $(item.name) atomicMax(inout $(item.name) mem, $(item.name) data)
8509
8509
{
8510
8510
typeRequireChecks_atomic_using_float2_tier< $(item .name )> ();
8511
8511
typeRequireChecks_atomic_using_MinMax< $(item .name )> ();
8512
- __target_switch
8513
- {
8514
- case glsl: __intrinsic_asm " atomicMax($0, $1)" ;
8515
- case spirv:
8516
- return spirv_asm
8517
- {
8518
- OpAtomic$(item .subclassType )Max$(item .suffix ) $$$(item .name ) result & mem Device UniformMemory $data
8519
- };
8520
- }
8512
+ return atomicMaxWithOrder(mem, data, MemoryOrder::Relaxed);
8521
8513
}
8522
8514
8515
+ __glsl_version(430 )
8516
+ [ForceInline]
8517
+ [require(glsl_spirv, atomic_glsl)]
8518
+ __intrinsic_op($(kIROp_AtomicExchange ))
8519
+ $(item .name ) atomicExchangeWithOrder(inout $(item .name ) mem, $(item .name ) data, MemoryOrder order);
8523
8520
8524
8521
__glsl_version(430 )
8525
8522
[ForceInline]
8526
8523
[require(glsl_spirv, atomic_glsl)]
8527
8524
public $(item .name ) atomicExchange(inout $(item .name ) mem, $(item .name ) data)
8528
8525
{
8529
8526
typeRequireChecks_atomic_using_float1_tier< $(item .name )> ();
8530
- __target_switch
8531
- {
8532
- case glsl: __intrinsic_asm " atomicExchange($0, $1)" ;
8533
- case spirv:
8534
- return spirv_asm
8535
- {
8536
- OpAtomicExchange $$$(item .name ) result & mem Device UniformMemory $data
8537
- };
8538
- }
8527
+ return atomicExchangeWithOrder(mem, data, MemoryOrder::Relaxed);
8539
8528
}
8540
8529
8541
8530
${{{{
@@ -8544,27 +8533,27 @@ if(item.isFloat)
8544
8533
}}}}
8545
8534
8546
8535
8536
+ __glsl_version(430 )
8537
+ [ForceInline]
8538
+ [require(glsl_spirv, atomic_glsl)]
8539
+ __intrinsic_op($(kIROp_AtomicAnd ))
8540
+ $(item .name ) atomicAndWithOrder(inout $(item .name ) mem, $(item .name ) data, MemoryOrder order);
8541
+
8547
8542
__glsl_version(430 )
8548
8543
[ForceInline]
8549
8544
[require(glsl_spirv, atomic_glsl)]
8550
8545
public $(item .name ) atomicAnd(inout $(item .name ) mem, $(item .name ) data)
8551
8546
{
8552
8547
typeRequireChecks_atomic_using_float0_tier< $(item .name )> ();
8553
8548
typeRequireChecks_atomic_using_Logical_CAS< $(item .name )> ();
8554
- __target_switch
8555
- {
8556
- case glsl:
8557
- {
8558
- __intrinsic_asm " atomicAnd($0, $1)" ;
8559
- }
8560
- case spirv:
8561
- return spirv_asm
8562
- {
8563
- OpAtomicAnd $$$(item .name ) result & mem Device UniformMemory $data
8564
- };
8565
- }
8549
+ return atomicAndWithOrder(mem, data, MemoryOrder::Relaxed);
8566
8550
}
8567
8551
8552
+ __glsl_version(430 )
8553
+ [ForceInline]
8554
+ [require(glsl_spirv, atomic_glsl)]
8555
+ __intrinsic_op($(kIROp_AtomicOr ))
8556
+ $(item .name ) atomicOrWithOrder(inout $(item .name ) mem, $(item .name ) data, MemoryOrder order);
8568
8557
8569
8558
__glsl_version(430 )
8570
8559
[ForceInline]
@@ -8573,36 +8562,31 @@ public $(item.name) atomicOr(inout $(item.name) mem, $(item.name) data)
8573
8562
{
8574
8563
typeRequireChecks_atomic_using_float0_tier< $(item .name )> ();
8575
8564
typeRequireChecks_atomic_using_Logical_CAS< $(item .name )> ();
8576
- __target_switch
8577
- {
8578
- case glsl: __intrinsic_asm " atomicOr($0, $1)" ;
8579
- case spirv:
8580
- return spirv_asm
8581
- {
8582
- OpAtomicOr $$$(item .name ) result & mem Device UniformMemory $data
8583
- };
8584
- }
8565
+ return atomicOrWithOrder(mem, data, MemoryOrder::Relaxed);
8585
8566
}
8586
8567
8587
8568
8569
+ __glsl_version(430 )
8570
+ [ForceInline]
8571
+ [require(glsl_spirv, atomic_glsl)]
8572
+ __intrinsic_op($(kIROp_AtomicXor ))
8573
+ $(item .name ) atomicXorWithOrder(inout $(item .name ) mem, $(item .name ) data, MemoryOrder order);
8574
+
8588
8575
__glsl_version(430 )
8589
8576
[ForceInline]
8590
8577
[require(glsl_spirv, atomic_glsl)]
8591
8578
public $(item .name ) atomicXor(inout $(item .name ) mem, $(item .name ) data)
8592
8579
{
8593
8580
typeRequireChecks_atomic_using_float0_tier< $(item .name )> ();
8594
8581
typeRequireChecks_atomic_using_Logical_CAS< $(item .name )> ();
8595
- __target_switch
8596
- {
8597
- case glsl: __intrinsic_asm " atomicXor($0, $1)" ;
8598
- case spirv:
8599
- return spirv_asm
8600
- {
8601
- OpAtomicXor $$$(item .name ) result & mem Device UniformMemory $data
8602
- };
8603
- }
8582
+ return atomicXorWithOrder(mem, data, MemoryOrder::Relaxed);
8604
8583
}
8605
8584
8585
+ __glsl_version(430 )
8586
+ [ForceInline]
8587
+ [require(glsl_spirv, atomic_glsl)]
8588
+ __intrinsic_op($(kIROp_AtomicCompareExchange ))
8589
+ $(item .name ) atomicCompSwapWithOrder(inout $(item .name ) mem, $(item .name ) compare, $(item .name ) data, MemoryOrder successOrder, MemoryOrder failOrder);
8606
8590
8607
8591
__glsl_version(430 )
8608
8592
[ForceInline]
@@ -8611,15 +8595,7 @@ public $(item.name) atomicCompSwap(inout $(item.name) mem, $(item.name) compare,
8611
8595
{
8612
8596
typeRequireChecks_atomic_using_float0_tier< $(item .name )> ();
8613
8597
typeRequireChecks_atomic_using_Logical_CAS< $(item .name )> ();
8614
- __target_switch
8615
- {
8616
- case glsl: __intrinsic_asm " atomicCompSwap($0, $1, $2)" ;
8617
- case spirv:
8618
- return spirv_asm
8619
- {
8620
- result:$$$(item .name ) = OpAtomicCompareExchange & mem Device None None $data $compare
8621
- };
8622
- }
8598
+ return atomicCompSwapWithOrder(mem, compare, data, MemoryOrder::Relaxed, MemoryOrder::Relaxed);
8623
8599
}
8624
8600
8625
8601
${{{{
0 commit comments