mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-12-15 19:49:40 +00:00
fix pre-action crash (ryubing/ryujinx!236)
See merge request ryubing/ryujinx!236
This commit is contained in:
parent
3a593b6084
commit
2c0977f6b3
@ -404,9 +404,12 @@ namespace Ryujinx.Graphics.Gpu
|
||||
|
||||
if (force || _pendingSync || (syncPoint && SyncpointActions.Count > 0))
|
||||
{
|
||||
foreach (ISyncActionHandler action in SyncActions)
|
||||
for (int i = 0; i < SyncActions.Count; i++)
|
||||
{
|
||||
action.SyncPreAction(syncPoint);
|
||||
if (SyncActions[i].SyncPreAction(syncPoint))
|
||||
{
|
||||
SyncActions.RemoveAt(i--);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ISyncActionHandler action in SyncpointActions)
|
||||
|
||||
@ -411,7 +411,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// flushes often enough, which is determined by the flush balance.
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
public void SyncPreAction(bool syncpoint)
|
||||
public bool SyncPreAction(bool syncpoint)
|
||||
{
|
||||
if (syncpoint || NextSyncCopies())
|
||||
{
|
||||
@ -421,6 +421,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
_registeredBufferSync = _modifiedSync;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -393,11 +393,16 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
||||
/// This will copy any buffer ranges designated for pre-flushing.
|
||||
/// </summary>
|
||||
/// <param name="syncpoint">True if the action is a guest syncpoint</param>
|
||||
public void SyncPreAction(bool syncpoint)
|
||||
public bool SyncPreAction(bool syncpoint)
|
||||
{
|
||||
if (_bufferInherited)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_referenceCount == 0)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (BackingState.ShouldChangeBacking())
|
||||
@ -414,6 +419,8 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
||||
_modifiedRanges?.GetRangesAtSync(Address, Size, _context.SyncNumber, _syncPreRangeAction);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SyncPreRangeAction(ulong address, ulong size)
|
||||
|
||||
@ -17,6 +17,6 @@ namespace Ryujinx.Graphics.Gpu.Synchronization
|
||||
/// Action to be performed immediately before sync is created.
|
||||
/// </summary>
|
||||
/// <param name="syncpoint">True if the action is a guest syncpoint</param>
|
||||
void SyncPreAction(bool syncpoint) { }
|
||||
bool SyncPreAction(bool syncpoint) { return true; }
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user