1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-12 15:12:02 +00:00

Do not clear gpu subchannel state on BindChannel (#2348)

This fixes a regression caused by #980, that was causing a crash on New
Super Lucky's Tale.

As always, this need feedback on possible regression on any games.

Fix #2343.
This commit is contained in:
Mary 2021-06-09 00:50:18 +02:00 committed by GitHub
parent 02e2e561ac
commit 60cf3dfebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -140,7 +140,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo
{ {
if ((MethodOffset)meth.Method == MethodOffset.BindChannel) if ((MethodOffset)meth.Method == MethodOffset.BindChannel)
{ {
_subChannels[meth.SubChannel] = new GpuState(); _subChannels[meth.SubChannel].ClearCallbacks();
_context.Methods.RegisterCallbacks(_subChannels[meth.SubChannel]); _context.Methods.RegisterCallbacks(_subChannels[meth.SubChannel]);
} }

View file

@ -210,6 +210,17 @@ namespace Ryujinx.Graphics.Gpu.State
_registers[(int)offset].Callback = callback; _registers[(int)offset].Callback = callback;
} }
/// <summary>
/// Clear all registered callbacks.
/// </summary>
public void ClearCallbacks()
{
for (int index = 0; index < _registers.Length; index++)
{
_registers[index].Callback = null;
}
}
/// <summary> /// <summary>
/// Checks if a given register has been modified since the last call to this method. /// Checks if a given register has been modified since the last call to this method.
/// </summary> /// </summary>