修改水

This commit is contained in:
2026-01-01 22:00:33 +08:00
parent 040a222bd6
commit 9ceffccd39
1800 changed files with 103929 additions and 139495 deletions

View File

@@ -1,46 +0,0 @@
#ifndef INTERLOCKEDUTILS_INCLUDE
#define INTERLOCKEDUTILS_INCLUDE
void InterlockedAddFloat(RWStructuredBuffer<uint4> buffer, int index, int axis, float value)
{
uint i_val = asuint(value);
uint tmp0 = 0;
uint tmp1;
[allow_uav_condition]
while (true)
{
InterlockedCompareExchange(buffer[index][axis], tmp0, i_val, tmp1);
if (tmp1 == tmp0)
break;
tmp0 = tmp1;
i_val = asuint(value + asfloat(tmp1));
}
return;
}
void InterlockedAddFloat(RWStructuredBuffer<uint> buffer, int index, float value)
{
uint i_val = asuint(value);
uint tmp0 = 0;
uint tmp1;
[allow_uav_condition]
while (true)
{
InterlockedCompareExchange(buffer[index], tmp0, i_val, tmp1);
if (tmp1 == tmp0)
break;
tmp0 = tmp1;
i_val = asuint(value + asfloat(tmp1));
}
return;
}
#endif