mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
fix(namer): normalize ":<>," characters to a snake case separator
This commit is contained in:
parent
90702156af
commit
5146b3f8ae
@ -119,6 +119,12 @@ impl Namer {
|
||||
Cow::Borrowed(string)
|
||||
} else {
|
||||
let mut filtered = string.chars().fold(String::new(), |mut s, c| {
|
||||
let c = match c {
|
||||
// Make several common characters in C++-ish types become snake case
|
||||
// separators.
|
||||
':' | '<' | '>' | ',' => '_',
|
||||
c => c,
|
||||
};
|
||||
let had_underscore_at_end = s.ends_with('_');
|
||||
if had_underscore_at_end && c == '_' {
|
||||
return s;
|
||||
|
||||
@ -5,11 +5,11 @@ precision highp int;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_4_ {
|
||||
int old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_4_ {
|
||||
uint old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
@ -50,7 +50,7 @@ void main() {
|
||||
int new = floatBitsToInt((intBitsToFloat(_e14) + 1.0));
|
||||
uint _e20 = i;
|
||||
int _e22 = old;
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e23; _e23.old_value = atomicCompSwap(_group_0_binding_0_cs[_e20], _e22, new);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e23; _e23.old_value = atomicCompSwap(_group_0_binding_0_cs[_e20], _e22, new);
|
||||
_e23.exchanged = (_e23.old_value == _e22);
|
||||
old = _e23.old_value;
|
||||
exchanged = _e23.exchanged;
|
||||
|
||||
@ -5,11 +5,11 @@ precision highp int;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_4_ {
|
||||
int old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_4_ {
|
||||
uint old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
@ -50,7 +50,7 @@ void main() {
|
||||
uint new = floatBitsToUint((uintBitsToFloat(_e14) + 1.0));
|
||||
uint _e20 = i_1;
|
||||
uint _e22 = old_1;
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e23; _e23.old_value = atomicCompSwap(_group_0_binding_1_cs[_e20], _e22, new);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e23; _e23.old_value = atomicCompSwap(_group_0_binding_1_cs[_e20], _e22, new);
|
||||
_e23.exchanged = (_e23.old_value == _e22);
|
||||
old_1 = _e23.old_value;
|
||||
exchanged_1 = _e23.exchanged;
|
||||
|
||||
@ -9,11 +9,11 @@ struct Struct {
|
||||
uint atomic_scalar;
|
||||
int atomic_arr[2];
|
||||
};
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_4_ {
|
||||
uint old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_4_ {
|
||||
int old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
@ -135,21 +135,21 @@ void main() {
|
||||
int _e295 = atomicExchange(workgroup_atomic_arr[1], 1);
|
||||
uint _e299 = atomicExchange(workgroup_struct.atomic_scalar, 1u);
|
||||
int _e304 = atomicExchange(workgroup_struct.atomic_arr[1], 1);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e308; _e308.old_value = atomicCompSwap(_group_0_binding_0_cs, 1u, 2u);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e308; _e308.old_value = atomicCompSwap(_group_0_binding_0_cs, 1u, 2u);
|
||||
_e308.exchanged = (_e308.old_value == 1u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e313; _e313.old_value = atomicCompSwap(_group_0_binding_1_cs[1], 1, 2);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e313; _e313.old_value = atomicCompSwap(_group_0_binding_1_cs[1], 1, 2);
|
||||
_e313.exchanged = (_e313.old_value == 1);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e318; _e318.old_value = atomicCompSwap(_group_0_binding_2_cs.atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e318; _e318.old_value = atomicCompSwap(_group_0_binding_2_cs.atomic_scalar, 1u, 2u);
|
||||
_e318.exchanged = (_e318.old_value == 1u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e324; _e324.old_value = atomicCompSwap(_group_0_binding_2_cs.atomic_arr[1], 1, 2);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e324; _e324.old_value = atomicCompSwap(_group_0_binding_2_cs.atomic_arr[1], 1, 2);
|
||||
_e324.exchanged = (_e324.old_value == 1);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e328; _e328.old_value = atomicCompSwap(workgroup_atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e328; _e328.old_value = atomicCompSwap(workgroup_atomic_scalar, 1u, 2u);
|
||||
_e328.exchanged = (_e328.old_value == 1u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e333; _e333.old_value = atomicCompSwap(workgroup_atomic_arr[1], 1, 2);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e333; _e333.old_value = atomicCompSwap(workgroup_atomic_arr[1], 1, 2);
|
||||
_e333.exchanged = (_e333.old_value == 1);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e338; _e338.old_value = atomicCompSwap(workgroup_struct.atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e338; _e338.old_value = atomicCompSwap(workgroup_struct.atomic_scalar, 1u, 2u);
|
||||
_e338.exchanged = (_e338.old_value == 1u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e344; _e344.old_value = atomicCompSwap(workgroup_struct.atomic_arr[1], 1, 2);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e344; _e344.old_value = atomicCompSwap(workgroup_struct.atomic_arr[1], 1, 2);
|
||||
_e344.exchanged = (_e344.old_value == 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ void function()
|
||||
}
|
||||
|
||||
[numthreads(32, 1, 1)]
|
||||
void cull_u003a_u003a_fetch_depth()
|
||||
void cull_fetch_depth()
|
||||
{
|
||||
function();
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
],
|
||||
compute:[
|
||||
(
|
||||
entry_point:"cull_u003a_u003a_fetch_depth",
|
||||
entry_point:"cull_fetch_depth",
|
||||
target_profile:"cs_5_1",
|
||||
),
|
||||
],
|
||||
|
||||
@ -5,13 +5,13 @@ struct NagaConstants {
|
||||
};
|
||||
ConstantBuffer<NagaConstants> _NagaConstants: register(b0, space1);
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_8_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_8_ {
|
||||
int64_t old_value;
|
||||
bool exchanged;
|
||||
int _end_pad_0;
|
||||
};
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_8_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_8_ {
|
||||
uint64_t old_value;
|
||||
bool exchanged;
|
||||
int _end_pad_0;
|
||||
@ -63,7 +63,7 @@ void test_atomic_compare_exchange_i64_()
|
||||
int64_t new_ = (_e14 + 10L);
|
||||
uint _e19 = i;
|
||||
int64_t _e21 = old;
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_8_u003e _e22; arr_i64_.InterlockedCompareExchange64(_e19*8, _e21, new_, _e22.old_value);
|
||||
_atomic_compare_exchange_result_Sint_8_ _e22; arr_i64_.InterlockedCompareExchange64(_e19*8, _e21, new_, _e22.old_value);
|
||||
_e22.exchanged = (_e22.old_value == _e21);
|
||||
old = _e22.old_value;
|
||||
exchanged = _e22.exchanged;
|
||||
@ -115,7 +115,7 @@ void test_atomic_compare_exchange_u64_()
|
||||
uint64_t new_1 = (_e14 + 10uL);
|
||||
uint _e19 = i_1;
|
||||
uint64_t _e21 = old_1;
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_8_u003e _e22; arr_u64_.InterlockedCompareExchange64(_e19*8, _e21, new_1, _e22.old_value);
|
||||
_atomic_compare_exchange_result_Uint_8_ _e22; arr_u64_.InterlockedCompareExchange64(_e19*8, _e21, new_1, _e22.old_value);
|
||||
_e22.exchanged = (_e22.old_value == _e21);
|
||||
old_1 = _e22.old_value;
|
||||
exchanged_1 = _e22.exchanged;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_4_ {
|
||||
int old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_4_ {
|
||||
uint old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
@ -54,7 +54,7 @@ void test_atomic_compare_exchange_i32_()
|
||||
int new_ = asint((asfloat(_e14) + 1.0));
|
||||
uint _e20 = i;
|
||||
int _e22 = old;
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e23; arr_i32_.InterlockedCompareExchange(_e20*4, _e22, new_, _e23.old_value);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e23; arr_i32_.InterlockedCompareExchange(_e20*4, _e22, new_, _e23.old_value);
|
||||
_e23.exchanged = (_e23.old_value == _e22);
|
||||
old = _e23.old_value;
|
||||
exchanged = _e23.exchanged;
|
||||
@ -106,7 +106,7 @@ void test_atomic_compare_exchange_u32_()
|
||||
uint new_1 = asuint((asfloat(_e14) + 1.0));
|
||||
uint _e20 = i_1;
|
||||
uint _e22 = old_1;
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e23; arr_u32_.InterlockedCompareExchange(_e20*4, _e22, new_1, _e23.old_value);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e23; arr_u32_.InterlockedCompareExchange(_e20*4, _e22, new_1, _e23.old_value);
|
||||
_e23.exchanged = (_e23.old_value == _e22);
|
||||
old_1 = _e23.old_value;
|
||||
exchanged_1 = _e23.exchanged;
|
||||
|
||||
@ -10,13 +10,13 @@ struct Struct {
|
||||
int64_t atomic_arr[2];
|
||||
};
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_8_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_8_ {
|
||||
uint64_t old_value;
|
||||
bool exchanged;
|
||||
int _end_pad_0;
|
||||
};
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_8_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_8_ {
|
||||
int64_t old_value;
|
||||
bool exchanged;
|
||||
int _end_pad_0;
|
||||
@ -126,21 +126,21 @@ void cs_main(uint3 id : SV_GroupThreadID, uint3 __local_invocation_id : SV_Group
|
||||
int64_t _e279; InterlockedExchange(workgroup_atomic_arr[1], 1L, _e279);
|
||||
uint64_t _e283; InterlockedExchange(workgroup_struct.atomic_scalar, 1uL, _e283);
|
||||
int64_t _e288; InterlockedExchange(workgroup_struct.atomic_arr[1], 1L, _e288);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_8_u003e _e292; storage_atomic_scalar.InterlockedCompareExchange64(0, 1uL, 2uL, _e292.old_value);
|
||||
_atomic_compare_exchange_result_Uint_8_ _e292; storage_atomic_scalar.InterlockedCompareExchange64(0, 1uL, 2uL, _e292.old_value);
|
||||
_e292.exchanged = (_e292.old_value == 1uL);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_8_u003e _e297; storage_atomic_arr.InterlockedCompareExchange64(8, 1L, 2L, _e297.old_value);
|
||||
_atomic_compare_exchange_result_Sint_8_ _e297; storage_atomic_arr.InterlockedCompareExchange64(8, 1L, 2L, _e297.old_value);
|
||||
_e297.exchanged = (_e297.old_value == 1L);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_8_u003e _e302; storage_struct.InterlockedCompareExchange64(0, 1uL, 2uL, _e302.old_value);
|
||||
_atomic_compare_exchange_result_Uint_8_ _e302; storage_struct.InterlockedCompareExchange64(0, 1uL, 2uL, _e302.old_value);
|
||||
_e302.exchanged = (_e302.old_value == 1uL);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_8_u003e _e308; storage_struct.InterlockedCompareExchange64(8+8, 1L, 2L, _e308.old_value);
|
||||
_atomic_compare_exchange_result_Sint_8_ _e308; storage_struct.InterlockedCompareExchange64(8+8, 1L, 2L, _e308.old_value);
|
||||
_e308.exchanged = (_e308.old_value == 1L);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_8_u003e _e312; InterlockedCompareExchange(workgroup_atomic_scalar, 1uL, 2uL, _e312.old_value);
|
||||
_atomic_compare_exchange_result_Uint_8_ _e312; InterlockedCompareExchange(workgroup_atomic_scalar, 1uL, 2uL, _e312.old_value);
|
||||
_e312.exchanged = (_e312.old_value == 1uL);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_8_u003e _e317; InterlockedCompareExchange(workgroup_atomic_arr[1], 1L, 2L, _e317.old_value);
|
||||
_atomic_compare_exchange_result_Sint_8_ _e317; InterlockedCompareExchange(workgroup_atomic_arr[1], 1L, 2L, _e317.old_value);
|
||||
_e317.exchanged = (_e317.old_value == 1L);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_8_u003e _e322; InterlockedCompareExchange(workgroup_struct.atomic_scalar, 1uL, 2uL, _e322.old_value);
|
||||
_atomic_compare_exchange_result_Uint_8_ _e322; InterlockedCompareExchange(workgroup_struct.atomic_scalar, 1uL, 2uL, _e322.old_value);
|
||||
_e322.exchanged = (_e322.old_value == 1uL);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_8_u003e _e328; InterlockedCompareExchange(workgroup_struct.atomic_arr[1], 1L, 2L, _e328.old_value);
|
||||
_atomic_compare_exchange_result_Sint_8_ _e328; InterlockedCompareExchange(workgroup_struct.atomic_arr[1], 1L, 2L, _e328.old_value);
|
||||
_e328.exchanged = (_e328.old_value == 1L);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3,12 +3,12 @@ struct Struct {
|
||||
int atomic_arr[2];
|
||||
};
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_4_ {
|
||||
uint old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_4_ {
|
||||
int old_value;
|
||||
bool exchanged;
|
||||
};
|
||||
@ -117,21 +117,21 @@ void cs_main(uint3 id : SV_GroupThreadID, uint3 __local_invocation_id : SV_Group
|
||||
int _e295; InterlockedExchange(workgroup_atomic_arr[1], int(1), _e295);
|
||||
uint _e299; InterlockedExchange(workgroup_struct.atomic_scalar, 1u, _e299);
|
||||
int _e304; InterlockedExchange(workgroup_struct.atomic_arr[1], int(1), _e304);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e308; storage_atomic_scalar.InterlockedCompareExchange(0, 1u, 2u, _e308.old_value);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e308; storage_atomic_scalar.InterlockedCompareExchange(0, 1u, 2u, _e308.old_value);
|
||||
_e308.exchanged = (_e308.old_value == 1u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e313; storage_atomic_arr.InterlockedCompareExchange(4, int(1), int(2), _e313.old_value);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e313; storage_atomic_arr.InterlockedCompareExchange(4, int(1), int(2), _e313.old_value);
|
||||
_e313.exchanged = (_e313.old_value == int(1));
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e318; storage_struct.InterlockedCompareExchange(0, 1u, 2u, _e318.old_value);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e318; storage_struct.InterlockedCompareExchange(0, 1u, 2u, _e318.old_value);
|
||||
_e318.exchanged = (_e318.old_value == 1u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e324; storage_struct.InterlockedCompareExchange(4+4, int(1), int(2), _e324.old_value);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e324; storage_struct.InterlockedCompareExchange(4+4, int(1), int(2), _e324.old_value);
|
||||
_e324.exchanged = (_e324.old_value == int(1));
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e328; InterlockedCompareExchange(workgroup_atomic_scalar, 1u, 2u, _e328.old_value);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e328; InterlockedCompareExchange(workgroup_atomic_scalar, 1u, 2u, _e328.old_value);
|
||||
_e328.exchanged = (_e328.old_value == 1u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e333; InterlockedCompareExchange(workgroup_atomic_arr[1], int(1), int(2), _e333.old_value);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e333; InterlockedCompareExchange(workgroup_atomic_arr[1], int(1), int(2), _e333.old_value);
|
||||
_e333.exchanged = (_e333.old_value == int(1));
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e338; InterlockedCompareExchange(workgroup_struct.atomic_scalar, 1u, 2u, _e338.old_value);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e338; InterlockedCompareExchange(workgroup_struct.atomic_scalar, 1u, 2u, _e338.old_value);
|
||||
_e338.exchanged = (_e338.old_value == 1u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e344; InterlockedCompareExchange(workgroup_struct.atomic_arr[1], int(1), int(2), _e344.old_value);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e344; InterlockedCompareExchange(workgroup_struct.atomic_arr[1], int(1), int(2), _e344.old_value);
|
||||
_e344.exchanged = (_e344.old_value == int(1));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ void function(
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void cull_u003a_u003a_fetch_depth(
|
||||
kernel void cull_fetch_depth(
|
||||
device type_2& global [[user(fake0)]]
|
||||
, device type_4 const& global_1 [[user(fake0)]]
|
||||
, metal::depth2d<float, metal::access::sample> global_2 [[user(fake0)]]
|
||||
|
||||
@ -10,19 +10,19 @@ struct type_2 {
|
||||
struct type_4 {
|
||||
metal::atomic_uint inner[128];
|
||||
};
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_4_ {
|
||||
int old_value;
|
||||
bool exchanged;
|
||||
char _pad2[3];
|
||||
};
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_4_ {
|
||||
uint old_value;
|
||||
bool exchanged;
|
||||
char _pad2[3];
|
||||
};
|
||||
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Sint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
device A *atomic_ptr,
|
||||
int cmp,
|
||||
int v
|
||||
@ -31,10 +31,10 @@ _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Sint_4_{cmp, swapped};
|
||||
}
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Sint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
threadgroup A *atomic_ptr,
|
||||
int cmp,
|
||||
int v
|
||||
@ -43,11 +43,11 @@ _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Sint_4_{cmp, swapped};
|
||||
}
|
||||
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Uint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
device A *atomic_ptr,
|
||||
uint cmp,
|
||||
uint v
|
||||
@ -56,10 +56,10 @@ _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Uint_4_{cmp, swapped};
|
||||
}
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Uint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
threadgroup A *atomic_ptr,
|
||||
uint cmp,
|
||||
uint v
|
||||
@ -68,7 +68,7 @@ _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Uint_4_{cmp, swapped};
|
||||
}
|
||||
constant uint SIZE = 128u;
|
||||
|
||||
@ -112,7 +112,7 @@ kernel void test_atomic_compare_exchange_i32_(
|
||||
int new_ = as_type<int>(as_type<float>(_e14) + 1.0);
|
||||
uint _e20 = i;
|
||||
int _e22 = old;
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e23 = naga_atomic_compare_exchange_weak_explicit(&arr_i32_.inner[_e20], _e22, new_);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e23 = naga_atomic_compare_exchange_weak_explicit(&arr_i32_.inner[_e20], _e22, new_);
|
||||
old = _e23.old_value;
|
||||
exchanged = _e23.exchanged;
|
||||
}
|
||||
@ -163,7 +163,7 @@ kernel void test_atomic_compare_exchange_u32_(
|
||||
uint new_1 = as_type<uint>(as_type<float>(_e14) + 1.0);
|
||||
uint _e20 = i_1;
|
||||
uint _e22 = old_1;
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e23 = naga_atomic_compare_exchange_weak_explicit(&arr_u32_.inner[_e20], _e22, new_1);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e23 = naga_atomic_compare_exchange_weak_explicit(&arr_u32_.inner[_e20], _e22, new_1);
|
||||
old_1 = _e23.old_value;
|
||||
exchanged_1 = _e23.exchanged;
|
||||
}
|
||||
|
||||
@ -11,19 +11,19 @@ struct Struct {
|
||||
metal::atomic_uint atomic_scalar;
|
||||
type_2 atomic_arr;
|
||||
};
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_4_ {
|
||||
uint old_value;
|
||||
bool exchanged;
|
||||
char _pad2[3];
|
||||
};
|
||||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Sint_4_ {
|
||||
int old_value;
|
||||
bool exchanged;
|
||||
char _pad2[3];
|
||||
};
|
||||
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Uint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
device A *atomic_ptr,
|
||||
uint cmp,
|
||||
uint v
|
||||
@ -32,10 +32,10 @@ _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Uint_4_{cmp, swapped};
|
||||
}
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Uint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
threadgroup A *atomic_ptr,
|
||||
uint cmp,
|
||||
uint v
|
||||
@ -44,11 +44,11 @@ _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Uint_4_{cmp, swapped};
|
||||
}
|
||||
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Sint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
device A *atomic_ptr,
|
||||
int cmp,
|
||||
int v
|
||||
@ -57,10 +57,10 @@ _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Sint_4_{cmp, swapped};
|
||||
}
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Sint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
threadgroup A *atomic_ptr,
|
||||
int cmp,
|
||||
int v
|
||||
@ -69,7 +69,7 @@ _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Sint_4_{cmp, swapped};
|
||||
}
|
||||
|
||||
struct cs_mainInput {
|
||||
@ -182,13 +182,13 @@ kernel void cs_main(
|
||||
int _e295 = metal::atomic_exchange_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed);
|
||||
uint _e299 = metal::atomic_exchange_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed);
|
||||
int _e304 = metal::atomic_exchange_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e308 = naga_atomic_compare_exchange_weak_explicit(&storage_atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e313 = naga_atomic_compare_exchange_weak_explicit(&storage_atomic_arr.inner[1], 1, 2);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e318 = naga_atomic_compare_exchange_weak_explicit(&storage_struct.atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e324 = naga_atomic_compare_exchange_weak_explicit(&storage_struct.atomic_arr.inner[1], 1, 2);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e328 = naga_atomic_compare_exchange_weak_explicit(&workgroup_atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e333 = naga_atomic_compare_exchange_weak_explicit(&workgroup_atomic_arr.inner[1], 1, 2);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e338 = naga_atomic_compare_exchange_weak_explicit(&workgroup_struct.atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e344 = naga_atomic_compare_exchange_weak_explicit(&workgroup_struct.atomic_arr.inner[1], 1, 2);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e308 = naga_atomic_compare_exchange_weak_explicit(&storage_atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e313 = naga_atomic_compare_exchange_weak_explicit(&storage_atomic_arr.inner[1], 1, 2);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e318 = naga_atomic_compare_exchange_weak_explicit(&storage_struct.atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e324 = naga_atomic_compare_exchange_weak_explicit(&storage_struct.atomic_arr.inner[1], 1, 2);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e328 = naga_atomic_compare_exchange_weak_explicit(&workgroup_atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e333 = naga_atomic_compare_exchange_weak_explicit(&workgroup_atomic_arr.inner[1], 1, 2);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e338 = naga_atomic_compare_exchange_weak_explicit(&workgroup_struct.atomic_scalar, 1u, 2u);
|
||||
_atomic_compare_exchange_result_Sint_4_ _e344 = naga_atomic_compare_exchange_weak_explicit(&workgroup_struct.atomic_arr.inner[1], 1, 2);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4,14 +4,14 @@
|
||||
|
||||
using metal::uint;
|
||||
|
||||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e {
|
||||
struct _atomic_compare_exchange_result_Uint_4_ {
|
||||
uint old_value;
|
||||
bool exchanged;
|
||||
char _pad2[3];
|
||||
};
|
||||
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Uint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
device A *atomic_ptr,
|
||||
uint cmp,
|
||||
uint v
|
||||
@ -20,10 +20,10 @@ _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Uint_4_{cmp, swapped};
|
||||
}
|
||||
template <typename A>
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exchange_weak_explicit(
|
||||
_atomic_compare_exchange_result_Uint_4_ naga_atomic_compare_exchange_weak_explicit(
|
||||
threadgroup A *atomic_ptr,
|
||||
uint cmp,
|
||||
uint v
|
||||
@ -32,7 +32,7 @@ _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e naga_atomic_compare_exc
|
||||
atomic_ptr, &cmp, v,
|
||||
metal::memory_order_relaxed, metal::memory_order_relaxed
|
||||
);
|
||||
return _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e{cmp, swapped};
|
||||
return _atomic_compare_exchange_result_Uint_4_{cmp, swapped};
|
||||
}
|
||||
constant int o = 2;
|
||||
|
||||
@ -44,6 +44,6 @@ kernel void f(
|
||||
metal::atomic_store_explicit(&a, 0, metal::memory_order_relaxed);
|
||||
}
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
_atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e _e5 = naga_atomic_compare_exchange_weak_explicit(&a, 2u, 1u);
|
||||
_atomic_compare_exchange_result_Uint_4_ _e5 = naga_atomic_compare_exchange_weak_explicit(&a, 2u, 1u);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -61,6 +61,6 @@ fn function() {
|
||||
}
|
||||
|
||||
@compute @workgroup_size(32, 1, 1)
|
||||
fn stage_u003a_u003a_test_atomic_compare_exchange() {
|
||||
fn stage_test_atomic_compare_exchange() {
|
||||
function();
|
||||
}
|
||||
|
||||
@ -75,6 +75,6 @@ fn function() {
|
||||
}
|
||||
|
||||
@compute @workgroup_size(32, 1, 1)
|
||||
fn stage_u003a_u003a_test_atomic_exchange() {
|
||||
fn stage_test_atomic_exchange() {
|
||||
function();
|
||||
}
|
||||
|
||||
@ -21,6 +21,6 @@ fn function() {
|
||||
}
|
||||
|
||||
@compute @workgroup_size(32, 1, 1)
|
||||
fn stage_u003a_u003a_test_atomic_i_add_sub() {
|
||||
fn stage_test_atomic_i_add_sub() {
|
||||
function();
|
||||
}
|
||||
|
||||
@ -32,6 +32,6 @@ fn function() {
|
||||
}
|
||||
|
||||
@compute @workgroup_size(32, 1, 1)
|
||||
fn stage_u003a_u003a_test_atomic_i_decrement() {
|
||||
fn stage_test_atomic_i_decrement() {
|
||||
function();
|
||||
}
|
||||
|
||||
@ -37,6 +37,6 @@ fn function() {
|
||||
}
|
||||
|
||||
@compute @workgroup_size(32, 1, 1)
|
||||
fn stage_u003a_u003a_test_atomic_i_increment() {
|
||||
fn stage_test_atomic_i_increment() {
|
||||
function();
|
||||
}
|
||||
|
||||
@ -67,6 +67,6 @@ fn function() {
|
||||
}
|
||||
|
||||
@compute @workgroup_size(32, 1, 1)
|
||||
fn stage_u003a_u003a_test_atomic_load_and_store() {
|
||||
fn stage_test_atomic_load_and_store() {
|
||||
function();
|
||||
}
|
||||
|
||||
@ -21,6 +21,6 @@ fn function() {
|
||||
}
|
||||
|
||||
@compute @workgroup_size(32, 1, 1)
|
||||
fn cull_u003a_u003a_fetch_depth() {
|
||||
fn cull_fetch_depth() {
|
||||
function();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user