mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-01 14:27:27 +00:00
63f1663fa9
* Fix 8 and 16-bit STG * Fix 8 and 16-bit STS * Shader cache version bump
21 lines
No EOL
666 B
GLSL
21 lines
No EOL
666 B
GLSL
int Helper_AtomicMaxS32(int index, int offset, int value)
|
|
{
|
|
uint oldValue, newValue;
|
|
do
|
|
{
|
|
oldValue = $STORAGE_MEM$[index].data[offset];
|
|
newValue = uint(max(int(oldValue), value));
|
|
} while (atomicCompSwap($STORAGE_MEM$[index].data[offset], oldValue, newValue) != oldValue);
|
|
return int(oldValue);
|
|
}
|
|
|
|
int Helper_AtomicMinS32(int index, int offset, int value)
|
|
{
|
|
uint oldValue, newValue;
|
|
do
|
|
{
|
|
oldValue = $STORAGE_MEM$[index].data[offset];
|
|
newValue = uint(min(int(oldValue), value));
|
|
} while (atomicCompSwap($STORAGE_MEM$[index].data[offset], oldValue, newValue) != oldValue);
|
|
return int(oldValue);
|
|
} |