From 93df366b2c1ddb073410b8ce95c8225f52a49f33 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 14 Jan 2023 11:23:57 -0300 Subject: Fix texture flush from CPU WaitSync regression on OpenGL (#4289) --- Ryujinx.Graphics.Gpu/Image/TextureGroup.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics.Gpu/Image/TextureGroup.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs b/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs index a6e0616c..c167dc0d 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs @@ -1431,10 +1431,21 @@ namespace Ryujinx.Graphics.Gpu.Image return; } - handle.Sync(_context); + bool isGpuThread = _context.IsGpuThread(); + + if (isGpuThread) + { + // No need to wait if we're on the GPU thread, we can just clear the modified flag immediately. + handle.Modified = false; + } _context.Renderer.BackgroundContextAction(() => { + if (!isGpuThread) + { + handle.Sync(_context); + } + Storage.SignalModifiedDirty(); lock (handle.Overlaps) -- cgit v1.2.3