From 6e002bea076daca0b179252ac7cb04c90fa3b9aa Mon Sep 17 00:00:00 2001 From: LotP1 <68976644+LotP1@users.noreply.github.com> Date: Thu, 27 Nov 2025 03:31:25 +0100 Subject: [PATCH] fix inherited buffers still syncing when a buffer with a scheduled sync is inherited the new buffer automatically schedules itself, but doesn't unschedule the old buffer. combining the reuse of buffer ranges with the old buffer still having a sync scheduled causes the old buffer to sometimes try to sync with ranges that extend beyond its bounds. fix: stop syncing old buffers, the new buffers already sync the same areas. --- src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs b/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs index 30a415c30..f04576c2a 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs @@ -90,6 +90,7 @@ namespace Ryujinx.Graphics.Gpu.Memory private readonly bool _useGranular; private bool _syncActionRegistered; + private bool _bufferInherited; private int _referenceCount = 1; @@ -429,10 +430,13 @@ namespace Ryujinx.Graphics.Gpu.Memory { _syncActionRegistered = false; + if (_bufferInherited) + { + return true; + } + if (_useGranular) { - - _modifiedRanges?.GetRanges(Address, Size, _syncRangeAction); } else @@ -456,6 +460,8 @@ namespace Ryujinx.Graphics.Gpu.Memory /// The buffer to inherit from public void InheritModifiedRanges(Buffer from) { + from._bufferInherited = true; + if (from._modifiedRanges is { HasRanges: true }) { if (from._syncActionRegistered && !_syncActionRegistered)