mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-04-17 11:42:54 +00:00
Memory changes 2.2 (ryubing/ryujinx!143)
See merge request ryubing/ryujinx!143
This commit is contained in:
@@ -97,7 +97,7 @@ namespace Ryujinx.Graphics.Device
|
||||
uint alignedOffset = index * RegisterSize;
|
||||
DebugWrite(alignedOffset, data);
|
||||
|
||||
GetRefIntAlignedUncheck(index) = data;
|
||||
SetIntAlignedUncheck(index, data);
|
||||
|
||||
_writeCallbacks[index]?.Invoke(data);
|
||||
}
|
||||
@@ -112,9 +112,7 @@ namespace Ryujinx.Graphics.Device
|
||||
uint alignedOffset = index * RegisterSize;
|
||||
DebugWrite(alignedOffset, data);
|
||||
|
||||
ref int storage = ref GetRefIntAlignedUncheck(index);
|
||||
changed = storage != data;
|
||||
storage = data;
|
||||
changed = SetIntAlignedUncheckChanged(index, data);
|
||||
|
||||
_writeCallbacks[index]?.Invoke(data);
|
||||
}
|
||||
@@ -154,5 +152,24 @@ namespace Ryujinx.Graphics.Device
|
||||
{
|
||||
return ref Unsafe.Add(ref Unsafe.As<TState, int>(ref State), (nint)index);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private void SetIntAlignedUncheck(ulong index, int data)
|
||||
{
|
||||
Unsafe.Add(ref Unsafe.As<TState, int>(ref State), (nint)index) = data;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private bool SetIntAlignedUncheckChanged(ulong index, int data)
|
||||
{
|
||||
ref int val = ref Unsafe.Add(ref Unsafe.As<TState, int>(ref State), (nint)index);
|
||||
if (val == data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
val = data;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user