diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-01-14 11:23:57 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-14 11:23:57 -0300 |
commit | 93df366b2c1ddb073410b8ce95c8225f52a49f33 (patch) | |
tree | 142be5fccdd553250613b7cda981b6c6bfc20e2d /Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs | |
parent | cd3a15aea514234153d0afcaaed0009086492bd9 (diff) |
Fix texture flush from CPU WaitSync regression on OpenGL (#4289)1.1.555
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs b/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs index 34b59cff..1b83cb55 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs @@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Gpu.Image /// A tracking handle for a texture group, which represents a range of views in a storage texture. /// Retains a list of overlapping texture views, a modified flag, and tracking for each /// CPU VA range that the views cover. - /// Also tracks copy dependencies for the handle - references to other handles that must be kept + /// Also tracks copy dependencies for the handle - references to other handles that must be kept /// in sync with this one before use. /// </summary> class TextureGroupHandle : IDisposable @@ -232,32 +232,23 @@ namespace Ryujinx.Graphics.Gpu.Image /// <param name="context">The GPU context used to wait for sync</param> public void Sync(GpuContext context) { - bool needsSync = !context.IsGpuThread(); + ulong registeredSync = _registeredSync; + long diff = (long)(context.SyncNumber - registeredSync); - if (needsSync) + if (diff > 0) { - ulong registeredSync = _registeredSync; - long diff = (long)(context.SyncNumber - registeredSync); + context.Renderer.WaitSync(registeredSync); - if (diff > 0) + if ((long)(_modifiedSync - registeredSync) > 0) { - context.Renderer.WaitSync(registeredSync); - - if ((long)(_modifiedSync - registeredSync) > 0) - { - // Flush the data in a previous state. Do not remove the modified flag - it will be removed to ignore following writes. - return; - } - - Modified = false; + // Flush the data in a previous state. Do not remove the modified flag - it will be removed to ignore following writes. + return; } - - // If the difference is <= 0, no data is not ready yet. Flush any data we can without waiting or removing modified flag. - } - else - { + Modified = false; } + + // If the difference is <= 0, no data is not ready yet. Flush any data we can without waiting or removing modified flag. } /// <summary> |